From c4945118b660674dac9622b1d73c574f8622ce02 Mon Sep 17 00:00:00 2001 From: Sean O'Brien <60306702+stobrien89@users.noreply.github.com> Date: Thu, 29 Oct 2026 20:22:59 -0400 Subject: [PATCH 1/2] feat(codegen): lazily load operation definitions --- .../aws-json-1-0/src/awsjson10/client.py | 53 +- .../aws-json-1-0/src/awsjson10/models.py | 206 ++- .../aws-json-1-1/src/awsjson11/client.py | 69 +- .../aws-json-1-1/src/awsjson11/models.py | 222 ++- .../aws-query/src/awsquery/client.py | 128 +- .../aws-query/src/awsquery/models.py | 359 ++--- .../ec2-query/src/ec2query/client.py | 96 +- .../ec2-query/src/ec2query/models.py | 276 ++-- .../src/my_handwritten_model/client.py | 12 +- .../src/my_handwritten_model/models.py | 53 +- .../rest-json-1/src/restjson/client.py | 402 +++--- .../rest-json-1/src/restjson/models.py | 1207 +++++++---------- .../src/restxmlwithnamespace/client.py | 4 +- .../src/restxmlwithnamespace/models.py | 35 +- codegen-output/rest-xml/src/restxml/client.py | 230 ++-- codegen-output/rest-xml/src/restxml/models.py | 699 ++++------ .../rpcv2-cbor/src/rpcv2cbor/client.py | 51 +- .../rpcv2-cbor/src/rpcv2cbor/models.py | 180 ++- .../codegen/test/PythonCodegenTest.java | 9 + .../python/codegen/ClientGenerator.java | 15 +- .../generators/ModelModuleGenerator.java | 42 +- .../generators/OperationGenerator.java | 32 +- 22 files changed, 1873 insertions(+), 2507 deletions(-) diff --git a/codegen-output/aws-json-1-0/src/awsjson10/client.py b/codegen-output/aws-json-1-0/src/awsjson10/client.py index 18ffda0bf..a62f0ef7f 100644 --- a/codegen-output/aws-json-1-0/src/awsjson10/client.py +++ b/codegen-output/aws-json-1-0/src/awsjson10/client.py @@ -17,25 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncJSONRPC10Config, Plugin -from .models import ( - CONTENT_TYPE_PARAMETERS, - EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, - GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION, - JSON_UNIONS, - NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT, - OPERATION_WITH_DEFAULTS, - OPERATION_WITH_NESTED_STRUCTURE, - OPERATION_WITH_REQUIRED_MEMBERS, - OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS, - PUT_WITH_CONTENT_ENCODING, - QUERY_INCOMPATIBLE_OPERATION, - SIMPLE_SCALAR_PROPERTIES, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -209,7 +192,7 @@ async def content_type_parameters( An instance of `ContentTypeParametersOutput`. """ pipeline, call = await self._prepare_call( - input, CONTENT_TYPE_PARAMETERS, [], plugins + input, _models.CONTENT_TYPE_PARAMETERS, [], plugins ) return await pipeline(call) @@ -235,7 +218,7 @@ async def empty_input_and_empty_output( An instance of `EmptyInputAndEmptyOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins ) return await pipeline(call) @@ -258,7 +241,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -283,7 +266,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -310,7 +293,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -333,7 +316,7 @@ async def host_with_path_operation( An instance of `HostWithPathOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HOST_WITH_PATH_OPERATION, [], plugins + input, _models.HOST_WITH_PATH_OPERATION, [], plugins ) return await pipeline(call) @@ -355,7 +338,9 @@ async def json_unions( Returns: An instance of `JsonUnionsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_UNIONS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_UNIONS, [], plugins + ) return await pipeline(call) async def no_input_and_no_output( @@ -380,7 +365,7 @@ async def no_input_and_no_output( An instance of `NoInputAndNoOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_NO_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_NO_OUTPUT, [], plugins ) return await pipeline(call) @@ -406,7 +391,7 @@ async def no_input_and_output( An instance of `NoInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) @@ -429,7 +414,7 @@ async def operation_with_defaults( An instance of `OperationWithDefaultsOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_DEFAULTS, [], plugins + input, _models.OPERATION_WITH_DEFAULTS, [], plugins ) return await pipeline(call) @@ -454,7 +439,7 @@ async def operation_with_nested_structure( An instance of `OperationWithNestedStructureOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_NESTED_STRUCTURE, [], plugins + input, _models.OPERATION_WITH_NESTED_STRUCTURE, [], plugins ) return await pipeline(call) @@ -479,7 +464,7 @@ async def operation_with_required_members( An instance of `OperationWithRequiredMembersOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_REQUIRED_MEMBERS, [], plugins + input, _models.OPERATION_WITH_REQUIRED_MEMBERS, [], plugins ) return await pipeline(call) @@ -504,7 +489,7 @@ async def operation_with_required_members_with_defaults( An instance of `OperationWithRequiredMembersWithDefaultsOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS, [], plugins + input, _models.OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS, [], plugins ) return await pipeline(call) @@ -527,7 +512,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -552,7 +537,7 @@ async def query_incompatible_operation( An instance of `QueryIncompatibleOperationOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_INCOMPATIBLE_OPERATION, [], plugins + input, _models.QUERY_INCOMPATIBLE_OPERATION, [], plugins ) return await pipeline(call) @@ -575,6 +560,6 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) diff --git a/codegen-output/aws-json-1-0/src/awsjson10/models.py b/codegen-output/aws-json-1-0/src/awsjson10/models.py index 974578dec..3c2214f9a 100644 --- a/codegen-output/aws-json-1-0/src/awsjson10/models.py +++ b/codegen-output/aws-json-1-0/src/awsjson10/models.py @@ -6,25 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - CONTENT_TYPE_PARAMETERS as _SCHEMA_CONTENT_TYPE_PARAMETERS, - EMPTY_INPUT_AND_EMPTY_OUTPUT as _SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION as _SCHEMA_HOST_WITH_PATH_OPERATION, - JSON_UNIONS as _SCHEMA_JSON_UNIONS, - NO_INPUT_AND_NO_OUTPUT as _SCHEMA_NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT as _SCHEMA_NO_INPUT_AND_OUTPUT, - OPERATION_WITH_DEFAULTS as _SCHEMA_OPERATION_WITH_DEFAULTS, - OPERATION_WITH_NESTED_STRUCTURE as _SCHEMA_OPERATION_WITH_NESTED_STRUCTURE, - OPERATION_WITH_REQUIRED_MEMBERS as _SCHEMA_OPERATION_WITH_REQUIRED_MEMBERS, - OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS as _SCHEMA_OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - QUERY_INCOMPATIBLE_OPERATION as _SCHEMA_QUERY_INCOMPATIBLE_OPERATION, - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, -) - class ServiceError(ModeledError): """ @@ -156,123 +137,138 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "CONTENT_TYPE_PARAMETERS", + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "GREETING_WITH_ERRORS", + "HOST_WITH_PATH_OPERATION", + "JSON_UNIONS", + "NO_INPUT_AND_NO_OUTPUT", + "NO_INPUT_AND_OUTPUT", + "OPERATION_WITH_DEFAULTS", + "OPERATION_WITH_NESTED_STRUCTURE", + "OPERATION_WITH_REQUIRED_MEMBERS", + "OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS", + "PUT_WITH_CONTENT_ENCODING", + "QUERY_INCOMPATIBLE_OPERATION", + "SIMPLE_SCALAR_PROPERTIES", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -CONTENT_TYPE_PARAMETERS = APIOperation( - static_schema=_SCHEMA_CONTENT_TYPE_PARAMETERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -EMPTY_INPUT_AND_EMPTY_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONTENT_TYPE_PARAMETERS"] = ( + "CONTENT_TYPE_PARAMETERS", + (), + ("aws.auth#sigv4",), ) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["EMPTY_INPUT_AND_EMPTY_OUTPUT"] = ( + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + (), + ("aws.auth#sigv4",), ) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.json10#InvalidGreeting"), - ShapeID("aws.protocoltests.json10#ComplexError"), - ShapeID("aws.protocoltests.json10#FooError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) + +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -HOST_WITH_PATH_OPERATION = APIOperation( - static_schema=_SCHEMA_HOST_WITH_PATH_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "aws.protocoltests.json10#InvalidGreeting", + "aws.protocoltests.json10#ComplexError", + "aws.protocoltests.json10#FooError", + ), + ("aws.auth#sigv4",), ) -JSON_UNIONS = APIOperation( - static_schema=_SCHEMA_JSON_UNIONS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HOST_WITH_PATH_OPERATION"] = ( + "HOST_WITH_PATH_OPERATION", + (), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_NO_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_NO_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["JSON_UNIONS"] = ("JSON_UNIONS", (), ("aws.auth#sigv4",)) + +_operation_data["NO_INPUT_AND_NO_OUTPUT"] = ( + "NO_INPUT_AND_NO_OUTPUT", + (), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_OUTPUT"] = ( + "NO_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_DEFAULTS = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_DEFAULTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_DEFAULTS"] = ( + "OPERATION_WITH_DEFAULTS", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_NESTED_STRUCTURE = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_NESTED_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_NESTED_STRUCTURE"] = ( + "OPERATION_WITH_NESTED_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_REQUIRED_MEMBERS = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_REQUIRED_MEMBERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_REQUIRED_MEMBERS"] = ( + "OPERATION_WITH_REQUIRED_MEMBERS", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS"] = ( + "OPERATION_WITH_REQUIRED_MEMBERS_WITH_DEFAULTS", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -QUERY_INCOMPATIBLE_OPERATION = APIOperation( - static_schema=_SCHEMA_QUERY_INCOMPATIBLE_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_INCOMPATIBLE_OPERATION"] = ( + "QUERY_INCOMPATIBLE_OPERATION", + (), + ("aws.auth#sigv4",), ) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("aws.auth#sigv4",), ) diff --git a/codegen-output/aws-json-1-1/src/awsjson11/client.py b/codegen-output/aws-json-1-1/src/awsjson11/client.py index 2ae88bfe9..129ee459d 100644 --- a/codegen-output/aws-json-1-1/src/awsjson11/client.py +++ b/codegen-output/aws-json-1-1/src/awsjson11/client.py @@ -17,27 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncJsonProtocolConfig, Plugin -from .models import ( - CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS, - EMPTY_OPERATION, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION, - JSON_ENUMS, - JSON_INT_ENUMS, - JSON_UNIONS, - KITCHEN_SINK_OPERATION, - NULL_OPERATION, - OPERATION_WITH_OPTIONAL_INPUT_OUTPUT, - PUT_AND_GET_INLINE_DOCUMENTS, - PUT_WITH_CONTENT_ENCODING, - SIMPLE_SCALAR_PROPERTIES, - SPARSE_NULLS_OPERATION, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -215,7 +196,7 @@ async def content_type_parameters( An instance of `ContentTypeParametersOutput`. """ pipeline, call = await self._prepare_call( - input, CONTENT_TYPE_PARAMETERS, [], plugins + input, _models.CONTENT_TYPE_PARAMETERS, [], plugins ) return await pipeline(call) @@ -237,7 +218,9 @@ async def datetime_offsets( Returns: An instance of `DatetimeOffsetsOutput`. """ - pipeline, call = await self._prepare_call(input, DATETIME_OFFSETS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DATETIME_OFFSETS, [], plugins + ) return await pipeline(call) async def empty_operation( @@ -258,7 +241,9 @@ async def empty_operation( Returns: An instance of `EmptyOperationOutput`. """ - pipeline, call = await self._prepare_call(input, EMPTY_OPERATION, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.EMPTY_OPERATION, [], plugins + ) return await pipeline(call) async def endpoint_operation( @@ -280,7 +265,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -305,7 +290,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -328,7 +313,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -355,7 +340,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -378,7 +363,7 @@ async def host_with_path_operation( An instance of `HostWithPathOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HOST_WITH_PATH_OPERATION, [], plugins + input, _models.HOST_WITH_PATH_OPERATION, [], plugins ) return await pipeline(call) @@ -401,7 +386,9 @@ async def json_enums( Returns: An instance of `JsonEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_ENUMS, [], plugins + ) return await pipeline(call) async def json_int_enums( @@ -423,7 +410,9 @@ async def json_int_enums( Returns: An instance of `JsonIntEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_INT_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_INT_ENUMS, [], plugins + ) return await pipeline(call) async def json_unions( @@ -444,7 +433,9 @@ async def json_unions( Returns: An instance of `JsonUnionsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_UNIONS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_UNIONS, [], plugins + ) return await pipeline(call) async def kitchen_sink_operation( @@ -466,7 +457,7 @@ async def kitchen_sink_operation( An instance of `KitchenSinkOperationOutput`. """ pipeline, call = await self._prepare_call( - input, KITCHEN_SINK_OPERATION, [], plugins + input, _models.KITCHEN_SINK_OPERATION, [], plugins ) return await pipeline(call) @@ -488,7 +479,9 @@ async def null_operation( Returns: An instance of `NullOperationOutput`. """ - pipeline, call = await self._prepare_call(input, NULL_OPERATION, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.NULL_OPERATION, [], plugins + ) return await pipeline(call) async def operation_with_optional_input_output( @@ -512,7 +505,7 @@ async def operation_with_optional_input_output( An instance of `OperationWithOptionalInputOutputOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_OPTIONAL_INPUT_OUTPUT, [], plugins + input, _models.OPERATION_WITH_OPTIONAL_INPUT_OUTPUT, [], plugins ) return await pipeline(call) @@ -535,7 +528,7 @@ async def put_and_get_inline_documents( An instance of `PutAndGetInlineDocumentsOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_AND_GET_INLINE_DOCUMENTS, [], plugins + input, _models.PUT_AND_GET_INLINE_DOCUMENTS, [], plugins ) return await pipeline(call) @@ -558,7 +551,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -581,7 +574,7 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) @@ -604,6 +597,6 @@ async def sparse_nulls_operation( An instance of `SparseNullsOperationOutput`. """ pipeline, call = await self._prepare_call( - input, SPARSE_NULLS_OPERATION, [], plugins + input, _models.SPARSE_NULLS_OPERATION, [], plugins ) return await pipeline(call) diff --git a/codegen-output/aws-json-1-1/src/awsjson11/models.py b/codegen-output/aws-json-1-1/src/awsjson11/models.py index 4e91aa536..6b4917dde 100644 --- a/codegen-output/aws-json-1-1/src/awsjson11/models.py +++ b/codegen-output/aws-json-1-1/src/awsjson11/models.py @@ -6,27 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - CONTENT_TYPE_PARAMETERS as _SCHEMA_CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS as _SCHEMA_DATETIME_OFFSETS, - EMPTY_OPERATION as _SCHEMA_EMPTY_OPERATION, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION as _SCHEMA_HOST_WITH_PATH_OPERATION, - JSON_ENUMS as _SCHEMA_JSON_ENUMS, - JSON_INT_ENUMS as _SCHEMA_JSON_INT_ENUMS, - JSON_UNIONS as _SCHEMA_JSON_UNIONS, - KITCHEN_SINK_OPERATION as _SCHEMA_KITCHEN_SINK_OPERATION, - NULL_OPERATION as _SCHEMA_NULL_OPERATION, - OPERATION_WITH_OPTIONAL_INPUT_OUTPUT as _SCHEMA_OPERATION_WITH_OPTIONAL_INPUT_OUTPUT, - PUT_AND_GET_INLINE_DOCUMENTS as _SCHEMA_PUT_AND_GET_INLINE_DOCUMENTS, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, - SPARSE_NULLS_OPERATION as _SCHEMA_SPARSE_NULLS_OPERATION, -) - class ServiceError(ModeledError): """ @@ -159,140 +138,131 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "CONTENT_TYPE_PARAMETERS", + "DATETIME_OFFSETS", + "EMPTY_OPERATION", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "HOST_WITH_PATH_OPERATION", + "JSON_ENUMS", + "JSON_INT_ENUMS", + "JSON_UNIONS", + "KITCHEN_SINK_OPERATION", + "NULL_OPERATION", + "OPERATION_WITH_OPTIONAL_INPUT_OUTPUT", + "PUT_AND_GET_INLINE_DOCUMENTS", + "PUT_WITH_CONTENT_ENCODING", + "SIMPLE_SCALAR_PROPERTIES", + "SPARSE_NULLS_OPERATION", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -CONTENT_TYPE_PARAMETERS = APIOperation( - static_schema=_SCHEMA_CONTENT_TYPE_PARAMETERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -DATETIME_OFFSETS = APIOperation( - static_schema=_SCHEMA_DATETIME_OFFSETS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -EMPTY_OPERATION = APIOperation( - static_schema=_SCHEMA_EMPTY_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONTENT_TYPE_PARAMETERS"] = ( + "CONTENT_TYPE_PARAMETERS", + (), + ("aws.auth#sigv4",), ) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DATETIME_OFFSETS"] = ("DATETIME_OFFSETS", (), ("aws.auth#sigv4",)) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["EMPTY_OPERATION"] = ("EMPTY_OPERATION", (), ("aws.auth#sigv4",)) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.json#InvalidGreeting"), - ShapeID("aws.protocoltests.json#ComplexError"), - ShapeID("aws.protocoltests.json#FooError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -HOST_WITH_PATH_OPERATION = APIOperation( - static_schema=_SCHEMA_HOST_WITH_PATH_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FRACTIONAL_SECONDS"] = ("FRACTIONAL_SECONDS", (), ("aws.auth#sigv4",)) -JSON_ENUMS = APIOperation( - static_schema=_SCHEMA_JSON_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "aws.protocoltests.json#InvalidGreeting", + "aws.protocoltests.json#ComplexError", + "aws.protocoltests.json#FooError", + ), + ("aws.auth#sigv4",), ) -JSON_INT_ENUMS = APIOperation( - static_schema=_SCHEMA_JSON_INT_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HOST_WITH_PATH_OPERATION"] = ( + "HOST_WITH_PATH_OPERATION", + (), + ("aws.auth#sigv4",), ) -JSON_UNIONS = APIOperation( - static_schema=_SCHEMA_JSON_UNIONS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_ENUMS"] = ("JSON_ENUMS", (), ("aws.auth#sigv4",)) -NULL_OPERATION = APIOperation( - static_schema=_SCHEMA_NULL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_INT_ENUMS"] = ("JSON_INT_ENUMS", (), ("aws.auth#sigv4",)) + +_operation_data["JSON_UNIONS"] = ("JSON_UNIONS", (), ("aws.auth#sigv4",)) -OPERATION_WITH_OPTIONAL_INPUT_OUTPUT = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_OPTIONAL_INPUT_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NULL_OPERATION"] = ("NULL_OPERATION", (), ("aws.auth#sigv4",)) + +_operation_data["OPERATION_WITH_OPTIONAL_INPUT_OUTPUT"] = ( + "OPERATION_WITH_OPTIONAL_INPUT_OUTPUT", + (), + ("aws.auth#sigv4",), ) -PUT_AND_GET_INLINE_DOCUMENTS = APIOperation( - static_schema=_SCHEMA_PUT_AND_GET_INLINE_DOCUMENTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_AND_GET_INLINE_DOCUMENTS"] = ( + "PUT_AND_GET_INLINE_DOCUMENTS", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("aws.auth#sigv4",), ) -SPARSE_NULLS_OPERATION = APIOperation( - static_schema=_SCHEMA_SPARSE_NULLS_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SPARSE_NULLS_OPERATION"] = ( + "SPARSE_NULLS_OPERATION", + (), + ("aws.auth#sigv4",), ) -KITCHEN_SINK_OPERATION = APIOperation( - static_schema=_SCHEMA_KITCHEN_SINK_OPERATION, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.json#ErrorWithMembers"), - ShapeID("aws.protocoltests.json#ErrorWithoutMembers"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["KITCHEN_SINK_OPERATION"] = ( + "KITCHEN_SINK_OPERATION", + ( + "aws.protocoltests.json#ErrorWithMembers", + "aws.protocoltests.json#ErrorWithoutMembers", + ), + ("aws.auth#sigv4",), ) diff --git a/codegen-output/aws-query/src/awsquery/client.py b/codegen-output/aws-query/src/awsquery/client.py index 9aecb9534..fd2e05802 100644 --- a/codegen-output/aws-query/src/awsquery/client.py +++ b/codegen-output/aws-query/src/awsquery/client.py @@ -17,42 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncQueryProtocolConfig, Plugin -from .models import ( - DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, - FLATTENED_XML_MAP, - FLATTENED_XML_MAP_WITH_XML_NAME, - FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION, - IGNORES_WRAPPING_XML_NAME, - NESTED_STRUCTURES, - NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT, - PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_LISTS, - QUERY_MAPS, - QUERY_TIMESTAMPS, - RECURSIVE_XML_SHAPES, - SIMPLE_INPUT_PARAMS, - SIMPLE_SCALAR_XML_PROPERTIES, - XML_BLOBS, - XML_EMPTY_BLOBS, - XML_EMPTY_LISTS, - XML_EMPTY_MAPS, - XML_ENUMS, - XML_INT_ENUMS, - XML_LISTS, - XML_MAPS, - XML_MAPS_XML_NAME, - XML_NAMESPACES, - XML_TIMESTAMPS, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -258,7 +224,9 @@ async def datetime_offsets( Returns: An instance of `DatetimeOffsetsOutput`. """ - pipeline, call = await self._prepare_call(input, DATETIME_OFFSETS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DATETIME_OFFSETS, [], plugins + ) return await pipeline(call) async def empty_input_and_empty_output( @@ -282,7 +250,7 @@ async def empty_input_and_empty_output( An instance of `EmptyInputAndEmptyOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins ) return await pipeline(call) @@ -305,7 +273,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -330,7 +298,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -352,7 +320,9 @@ async def flattened_xml_map( Returns: An instance of `FlattenedXmlMapOutput`. """ - pipeline, call = await self._prepare_call(input, FLATTENED_XML_MAP, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.FLATTENED_XML_MAP, [], plugins + ) return await pipeline(call) async def flattened_xml_map_with_xml_name( @@ -376,7 +346,7 @@ async def flattened_xml_map_with_xml_name( An instance of `FlattenedXmlMapWithXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, FLATTENED_XML_MAP_WITH_XML_NAME, [], plugins + input, _models.FLATTENED_XML_MAP_WITH_XML_NAME, [], plugins ) return await pipeline(call) @@ -401,7 +371,7 @@ async def flattened_xml_map_with_xml_namespace( An instance of `FlattenedXmlMapWithXmlNamespaceOutput`. """ pipeline, call = await self._prepare_call( - input, FLATTENED_XML_MAP_WITH_XML_NAMESPACE, [], plugins + input, _models.FLATTENED_XML_MAP_WITH_XML_NAMESPACE, [], plugins ) return await pipeline(call) @@ -424,7 +394,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -449,7 +419,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -472,7 +442,7 @@ async def host_with_path_operation( An instance of `HostWithPathOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HOST_WITH_PATH_OPERATION, [], plugins + input, _models.HOST_WITH_PATH_OPERATION, [], plugins ) return await pipeline(call) @@ -497,7 +467,7 @@ async def ignores_wrapping_xml_name( An instance of `IgnoresWrappingXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, IGNORES_WRAPPING_XML_NAME, [], plugins + input, _models.IGNORES_WRAPPING_XML_NAME, [], plugins ) return await pipeline(call) @@ -519,7 +489,9 @@ async def nested_structures( Returns: An instance of `NestedStructuresOutput`. """ - pipeline, call = await self._prepare_call(input, NESTED_STRUCTURES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.NESTED_STRUCTURES, [], plugins + ) return await pipeline(call) async def no_input_and_no_output( @@ -544,7 +516,7 @@ async def no_input_and_no_output( An instance of `NoInputAndNoOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_NO_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_NO_OUTPUT, [], plugins ) return await pipeline(call) @@ -569,7 +541,7 @@ async def no_input_and_output( An instance of `NoInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) @@ -592,7 +564,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -617,7 +589,7 @@ async def query_idempotency_token_auto_fill( An instance of `QueryIdempotencyTokenAutoFillOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins + input, _models.QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins ) return await pipeline(call) @@ -639,7 +611,9 @@ async def query_lists( Returns: An instance of `QueryListsOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_LISTS, [], plugins + ) return await pipeline(call) async def query_maps( @@ -660,7 +634,9 @@ async def query_maps( Returns: An instance of `QueryMapsOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_MAPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_MAPS, [], plugins + ) return await pipeline(call) async def query_timestamps( @@ -684,7 +660,9 @@ async def query_timestamps( Returns: An instance of `QueryTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_TIMESTAMPS, [], plugins + ) return await pipeline(call) async def recursive_xml_shapes( @@ -706,7 +684,7 @@ async def recursive_xml_shapes( An instance of `RecursiveXmlShapesOutput`. """ pipeline, call = await self._prepare_call( - input, RECURSIVE_XML_SHAPES, [], plugins + input, _models.RECURSIVE_XML_SHAPES, [], plugins ) return await pipeline(call) @@ -729,7 +707,7 @@ async def simple_input_params( An instance of `SimpleInputParamsOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_INPUT_PARAMS, [], plugins + input, _models.SIMPLE_INPUT_PARAMS, [], plugins ) return await pipeline(call) @@ -752,7 +730,7 @@ async def simple_scalar_xml_properties( An instance of `SimpleScalarXmlPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_XML_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_XML_PROPERTIES, [], plugins ) return await pipeline(call) @@ -774,7 +752,7 @@ async def xml_blobs( Returns: An instance of `XmlBlobsOperationOutput`. """ - pipeline, call = await self._prepare_call(input, XML_BLOBS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_BLOBS, [], plugins) return await pipeline(call) async def xml_empty_blobs( @@ -795,7 +773,9 @@ async def xml_empty_blobs( Returns: An instance of `XmlEmptyBlobsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_BLOBS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_BLOBS, [], plugins + ) return await pipeline(call) async def xml_empty_lists( @@ -816,7 +796,9 @@ async def xml_empty_lists( Returns: An instance of `XmlEmptyListsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_LISTS, [], plugins + ) return await pipeline(call) async def xml_empty_maps( @@ -837,7 +819,9 @@ async def xml_empty_maps( Returns: An instance of `XmlEmptyMapsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_MAPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_MAPS, [], plugins + ) return await pipeline(call) async def xml_enums( @@ -859,7 +843,7 @@ async def xml_enums( Returns: An instance of `XmlEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_ENUMS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_ENUMS, [], plugins) return await pipeline(call) async def xml_int_enums( @@ -881,7 +865,9 @@ async def xml_int_enums( Returns: An instance of `XmlIntEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_INT_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_INT_ENUMS, [], plugins + ) return await pipeline(call) async def xml_lists( @@ -905,7 +891,7 @@ async def xml_lists( Returns: An instance of `XmlListsOperationOutput`. """ - pipeline, call = await self._prepare_call(input, XML_LISTS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_LISTS, [], plugins) return await pipeline(call) async def xml_maps( @@ -926,7 +912,7 @@ async def xml_maps( Returns: An instance of `XmlMapsOperationOutput`. """ - pipeline, call = await self._prepare_call(input, XML_MAPS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_MAPS, [], plugins) return await pipeline(call) async def xml_maps_xml_name( @@ -947,7 +933,9 @@ async def xml_maps_xml_name( Returns: An instance of `XmlMapsXmlNameOutput`. """ - pipeline, call = await self._prepare_call(input, XML_MAPS_XML_NAME, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_MAPS_XML_NAME, [], plugins + ) return await pipeline(call) async def xml_namespaces( @@ -968,7 +956,9 @@ async def xml_namespaces( Returns: An instance of `XmlNamespacesOutput`. """ - pipeline, call = await self._prepare_call(input, XML_NAMESPACES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_NAMESPACES, [], plugins + ) return await pipeline(call) async def xml_timestamps( @@ -990,5 +980,7 @@ async def xml_timestamps( Returns: An instance of `XmlTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_TIMESTAMPS, [], plugins + ) return await pipeline(call) diff --git a/codegen-output/aws-query/src/awsquery/models.py b/codegen-output/aws-query/src/awsquery/models.py index e58c36158..b7721eacc 100644 --- a/codegen-output/aws-query/src/awsquery/models.py +++ b/codegen-output/aws-query/src/awsquery/models.py @@ -6,42 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - DATETIME_OFFSETS as _SCHEMA_DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT as _SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - FLATTENED_XML_MAP as _SCHEMA_FLATTENED_XML_MAP, - FLATTENED_XML_MAP_WITH_XML_NAME as _SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAME, - FLATTENED_XML_MAP_WITH_XML_NAMESPACE as _SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION as _SCHEMA_HOST_WITH_PATH_OPERATION, - IGNORES_WRAPPING_XML_NAME as _SCHEMA_IGNORES_WRAPPING_XML_NAME, - NESTED_STRUCTURES as _SCHEMA_NESTED_STRUCTURES, - NO_INPUT_AND_NO_OUTPUT as _SCHEMA_NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT as _SCHEMA_NO_INPUT_AND_OUTPUT, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL as _SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_LISTS as _SCHEMA_QUERY_LISTS, - QUERY_MAPS as _SCHEMA_QUERY_MAPS, - QUERY_TIMESTAMPS as _SCHEMA_QUERY_TIMESTAMPS, - RECURSIVE_XML_SHAPES as _SCHEMA_RECURSIVE_XML_SHAPES, - SIMPLE_INPUT_PARAMS as _SCHEMA_SIMPLE_INPUT_PARAMS, - SIMPLE_SCALAR_XML_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_XML_PROPERTIES, - XML_BLOBS as _SCHEMA_XML_BLOBS, - XML_EMPTY_BLOBS as _SCHEMA_XML_EMPTY_BLOBS, - XML_EMPTY_LISTS as _SCHEMA_XML_EMPTY_LISTS, - XML_EMPTY_MAPS as _SCHEMA_XML_EMPTY_MAPS, - XML_ENUMS as _SCHEMA_XML_ENUMS, - XML_INT_ENUMS as _SCHEMA_XML_INT_ENUMS, - XML_LISTS as _SCHEMA_XML_LISTS, - XML_MAPS as _SCHEMA_XML_MAPS, - XML_MAPS_XML_NAME as _SCHEMA_XML_MAPS_XML_NAME, - XML_NAMESPACES as _SCHEMA_XML_NAMESPACES, - XML_TIMESTAMPS as _SCHEMA_XML_TIMESTAMPS, -) - class ServiceError(ModeledError): """ @@ -224,242 +188,189 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "DATETIME_OFFSETS", + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "FLATTENED_XML_MAP", + "FLATTENED_XML_MAP_WITH_XML_NAME", + "FLATTENED_XML_MAP_WITH_XML_NAMESPACE", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "HOST_WITH_PATH_OPERATION", + "IGNORES_WRAPPING_XML_NAME", + "NESTED_STRUCTURES", + "NO_INPUT_AND_NO_OUTPUT", + "NO_INPUT_AND_OUTPUT", + "PUT_WITH_CONTENT_ENCODING", + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + "QUERY_LISTS", + "QUERY_MAPS", + "QUERY_TIMESTAMPS", + "RECURSIVE_XML_SHAPES", + "SIMPLE_INPUT_PARAMS", + "SIMPLE_SCALAR_XML_PROPERTIES", + "XML_BLOBS", + "XML_EMPTY_BLOBS", + "XML_EMPTY_LISTS", + "XML_EMPTY_MAPS", + "XML_ENUMS", + "XML_INT_ENUMS", + "XML_LISTS", + "XML_MAPS", + "XML_MAPS_XML_NAME", + "XML_NAMESPACES", + "XML_TIMESTAMPS", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -DATETIME_OFFSETS = APIOperation( - static_schema=_SCHEMA_DATETIME_OFFSETS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -EMPTY_INPUT_AND_EMPTY_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DATETIME_OFFSETS"] = ("DATETIME_OFFSETS", (), ("aws.auth#sigv4",)) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["EMPTY_INPUT_AND_EMPTY_OUTPUT"] = ( + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + (), + ("aws.auth#sigv4",), ) -FLATTENED_XML_MAP = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) -FLATTENED_XML_MAP_WITH_XML_NAME = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -FLATTENED_XML_MAP_WITH_XML_NAMESPACE = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FLATTENED_XML_MAP"] = ("FLATTENED_XML_MAP", (), ("aws.auth#sigv4",)) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["FLATTENED_XML_MAP_WITH_XML_NAME"] = ( + "FLATTENED_XML_MAP_WITH_XML_NAME", + (), + ("aws.auth#sigv4",), ) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.query#InvalidGreeting"), - ShapeID("aws.protocoltests.query#ComplexError"), - ShapeID("aws.protocoltests.query#CustomCodeError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["FLATTENED_XML_MAP_WITH_XML_NAMESPACE"] = ( + "FLATTENED_XML_MAP_WITH_XML_NAMESPACE", + (), + ("aws.auth#sigv4",), ) -HOST_WITH_PATH_OPERATION = APIOperation( - static_schema=_SCHEMA_HOST_WITH_PATH_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FRACTIONAL_SECONDS"] = ("FRACTIONAL_SECONDS", (), ("aws.auth#sigv4",)) -IGNORES_WRAPPING_XML_NAME = APIOperation( - static_schema=_SCHEMA_IGNORES_WRAPPING_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "aws.protocoltests.query#InvalidGreeting", + "aws.protocoltests.query#ComplexError", + "aws.protocoltests.query#CustomCodeError", + ), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_NO_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_NO_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HOST_WITH_PATH_OPERATION"] = ( + "HOST_WITH_PATH_OPERATION", + (), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["IGNORES_WRAPPING_XML_NAME"] = ( + "IGNORES_WRAPPING_XML_NAME", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_NO_OUTPUT"] = ( + "NO_INPUT_AND_NO_OUTPUT", + (), + ("aws.auth#sigv4",), ) -QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL = APIOperation( - static_schema=_SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_OUTPUT"] = ( + "NO_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) -QUERY_LISTS = APIOperation( - static_schema=_SCHEMA_QUERY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -QUERY_MAPS = APIOperation( - static_schema=_SCHEMA_QUERY_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL"] = ( + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + (), + ("aws.auth#sigv4",), ) -QUERY_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_QUERY_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_LISTS"] = ("QUERY_LISTS", (), ("aws.auth#sigv4",)) -SIMPLE_INPUT_PARAMS = APIOperation( - static_schema=_SCHEMA_SIMPLE_INPUT_PARAMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_MAPS"] = ("QUERY_MAPS", (), ("aws.auth#sigv4",)) -SIMPLE_SCALAR_XML_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_XML_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_TIMESTAMPS"] = ("QUERY_TIMESTAMPS", (), ("aws.auth#sigv4",)) -XML_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_INPUT_PARAMS"] = ( + "SIMPLE_INPUT_PARAMS", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_XML_PROPERTIES"] = ( + "SIMPLE_SCALAR_XML_PROPERTIES", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_LISTS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_BLOBS"] = ("XML_BLOBS", (), ("aws.auth#sigv4",)) -XML_EMPTY_MAPS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_BLOBS"] = ("XML_EMPTY_BLOBS", (), ("aws.auth#sigv4",)) -XML_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_LISTS"] = ("XML_EMPTY_LISTS", (), ("aws.auth#sigv4",)) -XML_INT_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_INT_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_MAPS"] = ("XML_EMPTY_MAPS", (), ("aws.auth#sigv4",)) -XML_LISTS = APIOperation( - static_schema=_SCHEMA_XML_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_ENUMS"] = ("XML_ENUMS", (), ("aws.auth#sigv4",)) -XML_MAPS = APIOperation( - static_schema=_SCHEMA_XML_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_INT_ENUMS"] = ("XML_INT_ENUMS", (), ("aws.auth#sigv4",)) -XML_MAPS_XML_NAME = APIOperation( - static_schema=_SCHEMA_XML_MAPS_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_LISTS"] = ("XML_LISTS", (), ("aws.auth#sigv4",)) -XML_NAMESPACES = APIOperation( - static_schema=_SCHEMA_XML_NAMESPACES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_MAPS"] = ("XML_MAPS", (), ("aws.auth#sigv4",)) -XML_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_XML_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_MAPS_XML_NAME"] = ("XML_MAPS_XML_NAME", (), ("aws.auth#sigv4",)) -NESTED_STRUCTURES = APIOperation( - static_schema=_SCHEMA_NESTED_STRUCTURES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_NAMESPACES"] = ("XML_NAMESPACES", (), ("aws.auth#sigv4",)) + +_operation_data["XML_TIMESTAMPS"] = ("XML_TIMESTAMPS", (), ("aws.auth#sigv4",)) + +_operation_data["NESTED_STRUCTURES"] = ("NESTED_STRUCTURES", (), ("aws.auth#sigv4",)) -RECURSIVE_XML_SHAPES = APIOperation( - static_schema=_SCHEMA_RECURSIVE_XML_SHAPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["RECURSIVE_XML_SHAPES"] = ( + "RECURSIVE_XML_SHAPES", + (), + ("aws.auth#sigv4",), ) diff --git a/codegen-output/ec2-query/src/ec2query/client.py b/codegen-output/ec2-query/src/ec2query/client.py index 5b836b7d3..c863aa84f 100644 --- a/codegen-output/ec2-query/src/ec2query/client.py +++ b/codegen-output/ec2-query/src/ec2query/client.py @@ -17,34 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncEC2ProtocolConfig, Plugin -from .models import ( - DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION, - IGNORES_WRAPPING_XML_NAME, - NESTED_STRUCTURES, - NO_INPUT_AND_OUTPUT, - PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_LISTS, - QUERY_TIMESTAMPS, - RECURSIVE_XML_SHAPES, - SIMPLE_INPUT_PARAMS, - SIMPLE_SCALAR_XML_PROPERTIES, - XML_BLOBS, - XML_EMPTY_BLOBS, - XML_EMPTY_LISTS, - XML_ENUMS, - XML_INT_ENUMS, - XML_LISTS, - XML_NAMESPACES, - XML_TIMESTAMPS, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -234,7 +208,9 @@ async def datetime_offsets( Returns: An instance of `DatetimeOffsetsOutput`. """ - pipeline, call = await self._prepare_call(input, DATETIME_OFFSETS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DATETIME_OFFSETS, [], plugins + ) return await pipeline(call) async def empty_input_and_empty_output( @@ -258,7 +234,7 @@ async def empty_input_and_empty_output( An instance of `EmptyInputAndEmptyOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins ) return await pipeline(call) @@ -281,7 +257,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -306,7 +282,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -329,7 +305,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -354,7 +330,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -377,7 +353,7 @@ async def host_with_path_operation( An instance of `HostWithPathOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HOST_WITH_PATH_OPERATION, [], plugins + input, _models.HOST_WITH_PATH_OPERATION, [], plugins ) return await pipeline(call) @@ -401,7 +377,7 @@ async def ignores_wrapping_xml_name( An instance of `IgnoresWrappingXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, IGNORES_WRAPPING_XML_NAME, [], plugins + input, _models.IGNORES_WRAPPING_XML_NAME, [], plugins ) return await pipeline(call) @@ -423,7 +399,9 @@ async def nested_structures( Returns: An instance of `NestedStructuresOutput`. """ - pipeline, call = await self._prepare_call(input, NESTED_STRUCTURES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.NESTED_STRUCTURES, [], plugins + ) return await pipeline(call) async def no_input_and_output( @@ -447,7 +425,7 @@ async def no_input_and_output( An instance of `NoInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) @@ -470,7 +448,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -495,7 +473,7 @@ async def query_idempotency_token_auto_fill( An instance of `QueryIdempotencyTokenAutoFillOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins + input, _models.QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins ) return await pipeline(call) @@ -517,7 +495,9 @@ async def query_lists( Returns: An instance of `QueryListsOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_LISTS, [], plugins + ) return await pipeline(call) async def query_timestamps( @@ -541,7 +521,9 @@ async def query_timestamps( Returns: An instance of `QueryTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_TIMESTAMPS, [], plugins + ) return await pipeline(call) async def recursive_xml_shapes( @@ -563,7 +545,7 @@ async def recursive_xml_shapes( An instance of `RecursiveXmlShapesOutput`. """ pipeline, call = await self._prepare_call( - input, RECURSIVE_XML_SHAPES, [], plugins + input, _models.RECURSIVE_XML_SHAPES, [], plugins ) return await pipeline(call) @@ -586,7 +568,7 @@ async def simple_input_params( An instance of `SimpleInputParamsOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_INPUT_PARAMS, [], plugins + input, _models.SIMPLE_INPUT_PARAMS, [], plugins ) return await pipeline(call) @@ -609,7 +591,7 @@ async def simple_scalar_xml_properties( An instance of `SimpleScalarXmlPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_XML_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_XML_PROPERTIES, [], plugins ) return await pipeline(call) @@ -631,7 +613,7 @@ async def xml_blobs( Returns: An instance of `XmlBlobsOperationOutput`. """ - pipeline, call = await self._prepare_call(input, XML_BLOBS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_BLOBS, [], plugins) return await pipeline(call) async def xml_empty_blobs( @@ -652,7 +634,9 @@ async def xml_empty_blobs( Returns: An instance of `XmlEmptyBlobsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_BLOBS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_BLOBS, [], plugins + ) return await pipeline(call) async def xml_empty_lists( @@ -673,7 +657,9 @@ async def xml_empty_lists( Returns: An instance of `XmlEmptyListsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_LISTS, [], plugins + ) return await pipeline(call) async def xml_enums( @@ -695,7 +681,7 @@ async def xml_enums( Returns: An instance of `XmlEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_ENUMS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_ENUMS, [], plugins) return await pipeline(call) async def xml_int_enums( @@ -717,7 +703,9 @@ async def xml_int_enums( Returns: An instance of `XmlIntEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_INT_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_INT_ENUMS, [], plugins + ) return await pipeline(call) async def xml_lists( @@ -742,7 +730,7 @@ async def xml_lists( Returns: An instance of `XmlListsOperationOutput`. """ - pipeline, call = await self._prepare_call(input, XML_LISTS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_LISTS, [], plugins) return await pipeline(call) async def xml_namespaces( @@ -763,7 +751,9 @@ async def xml_namespaces( Returns: An instance of `XmlNamespacesOutput`. """ - pipeline, call = await self._prepare_call(input, XML_NAMESPACES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_NAMESPACES, [], plugins + ) return await pipeline(call) async def xml_timestamps( @@ -785,5 +775,7 @@ async def xml_timestamps( Returns: An instance of `XmlTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_TIMESTAMPS, [], plugins + ) return await pipeline(call) diff --git a/codegen-output/ec2-query/src/ec2query/models.py b/codegen-output/ec2-query/src/ec2query/models.py index 6a3ee98ca..6af7f9201 100644 --- a/codegen-output/ec2-query/src/ec2query/models.py +++ b/codegen-output/ec2-query/src/ec2query/models.py @@ -6,34 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - DATETIME_OFFSETS as _SCHEMA_DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT as _SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION as _SCHEMA_HOST_WITH_PATH_OPERATION, - IGNORES_WRAPPING_XML_NAME as _SCHEMA_IGNORES_WRAPPING_XML_NAME, - NESTED_STRUCTURES as _SCHEMA_NESTED_STRUCTURES, - NO_INPUT_AND_OUTPUT as _SCHEMA_NO_INPUT_AND_OUTPUT, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL as _SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_LISTS as _SCHEMA_QUERY_LISTS, - QUERY_TIMESTAMPS as _SCHEMA_QUERY_TIMESTAMPS, - RECURSIVE_XML_SHAPES as _SCHEMA_RECURSIVE_XML_SHAPES, - SIMPLE_INPUT_PARAMS as _SCHEMA_SIMPLE_INPUT_PARAMS, - SIMPLE_SCALAR_XML_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_XML_PROPERTIES, - XML_BLOBS as _SCHEMA_XML_BLOBS, - XML_EMPTY_BLOBS as _SCHEMA_XML_EMPTY_BLOBS, - XML_EMPTY_LISTS as _SCHEMA_XML_EMPTY_LISTS, - XML_ENUMS as _SCHEMA_XML_ENUMS, - XML_INT_ENUMS as _SCHEMA_XML_INT_ENUMS, - XML_LISTS as _SCHEMA_XML_LISTS, - XML_NAMESPACES as _SCHEMA_XML_NAMESPACES, - XML_TIMESTAMPS as _SCHEMA_XML_TIMESTAMPS, -) - class ServiceError(ModeledError): """ @@ -180,185 +152,149 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "DATETIME_OFFSETS", + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "HOST_WITH_PATH_OPERATION", + "IGNORES_WRAPPING_XML_NAME", + "NESTED_STRUCTURES", + "NO_INPUT_AND_OUTPUT", + "PUT_WITH_CONTENT_ENCODING", + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + "QUERY_LISTS", + "QUERY_TIMESTAMPS", + "RECURSIVE_XML_SHAPES", + "SIMPLE_INPUT_PARAMS", + "SIMPLE_SCALAR_XML_PROPERTIES", + "XML_BLOBS", + "XML_EMPTY_BLOBS", + "XML_EMPTY_LISTS", + "XML_ENUMS", + "XML_INT_ENUMS", + "XML_LISTS", + "XML_NAMESPACES", + "XML_TIMESTAMPS", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -DATETIME_OFFSETS = APIOperation( - static_schema=_SCHEMA_DATETIME_OFFSETS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -EMPTY_INPUT_AND_EMPTY_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DATETIME_OFFSETS"] = ("DATETIME_OFFSETS", (), ("aws.auth#sigv4",)) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["EMPTY_INPUT_AND_EMPTY_OUTPUT"] = ( + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + (), + ("aws.auth#sigv4",), ) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.ec2#InvalidGreeting"), - ShapeID("aws.protocoltests.ec2#ComplexError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -HOST_WITH_PATH_OPERATION = APIOperation( - static_schema=_SCHEMA_HOST_WITH_PATH_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FRACTIONAL_SECONDS"] = ("FRACTIONAL_SECONDS", (), ("aws.auth#sigv4",)) -IGNORES_WRAPPING_XML_NAME = APIOperation( - static_schema=_SCHEMA_IGNORES_WRAPPING_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ("aws.protocoltests.ec2#InvalidGreeting", "aws.protocoltests.ec2#ComplexError"), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HOST_WITH_PATH_OPERATION"] = ( + "HOST_WITH_PATH_OPERATION", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["IGNORES_WRAPPING_XML_NAME"] = ( + "IGNORES_WRAPPING_XML_NAME", + (), + ("aws.auth#sigv4",), ) -QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL = APIOperation( - static_schema=_SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_OUTPUT"] = ( + "NO_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) -QUERY_LISTS = APIOperation( - static_schema=_SCHEMA_QUERY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -QUERY_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_QUERY_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL"] = ( + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + (), + ("aws.auth#sigv4",), ) -SIMPLE_INPUT_PARAMS = APIOperation( - static_schema=_SCHEMA_SIMPLE_INPUT_PARAMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_LISTS"] = ("QUERY_LISTS", (), ("aws.auth#sigv4",)) -SIMPLE_SCALAR_XML_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_XML_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_TIMESTAMPS"] = ("QUERY_TIMESTAMPS", (), ("aws.auth#sigv4",)) -XML_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_INPUT_PARAMS"] = ( + "SIMPLE_INPUT_PARAMS", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_XML_PROPERTIES"] = ( + "SIMPLE_SCALAR_XML_PROPERTIES", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_LISTS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_BLOBS"] = ("XML_BLOBS", (), ("aws.auth#sigv4",)) -XML_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_BLOBS"] = ("XML_EMPTY_BLOBS", (), ("aws.auth#sigv4",)) -XML_INT_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_INT_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_LISTS"] = ("XML_EMPTY_LISTS", (), ("aws.auth#sigv4",)) -XML_LISTS = APIOperation( - static_schema=_SCHEMA_XML_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_ENUMS"] = ("XML_ENUMS", (), ("aws.auth#sigv4",)) -XML_NAMESPACES = APIOperation( - static_schema=_SCHEMA_XML_NAMESPACES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_INT_ENUMS"] = ("XML_INT_ENUMS", (), ("aws.auth#sigv4",)) -XML_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_XML_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_LISTS"] = ("XML_LISTS", (), ("aws.auth#sigv4",)) -NESTED_STRUCTURES = APIOperation( - static_schema=_SCHEMA_NESTED_STRUCTURES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_NAMESPACES"] = ("XML_NAMESPACES", (), ("aws.auth#sigv4",)) + +_operation_data["XML_TIMESTAMPS"] = ("XML_TIMESTAMPS", (), ("aws.auth#sigv4",)) + +_operation_data["NESTED_STRUCTURES"] = ("NESTED_STRUCTURES", (), ("aws.auth#sigv4",)) -RECURSIVE_XML_SHAPES = APIOperation( - static_schema=_SCHEMA_RECURSIVE_XML_SHAPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["RECURSIVE_XML_SHAPES"] = ( + "RECURSIVE_XML_SHAPES", + (), + ("aws.auth#sigv4",), ) diff --git a/codegen-output/my-handwritten-model/src/my_handwritten_model/client.py b/codegen-output/my-handwritten-model/src/my_handwritten_model/client.py index 488b24f3b..5e2974594 100644 --- a/codegen-output/my-handwritten-model/src/my_handwritten_model/client.py +++ b/codegen-output/my-handwritten-model/src/my_handwritten_model/client.py @@ -16,17 +16,15 @@ from smithy_core.serializers import SerializeableShape from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import Config, Plugin from .models import ( - PUBLISH_EVENTS, PublishEventStream, PublishEventsInput, PublishEventsOutput, - SUBSCRIBE_TO_EVENTS, SubscribeEventStream, SubscribeToEventsInput, SubscribeToEventsOutput, - TRADE_EVENT_STREAM, TradeEventStreamInput, TradeEventStreamOutput, TradeEvents, @@ -149,7 +147,9 @@ async def publish_events( Returns: An `InputEventStream` for client-to-server streaming. """ - pipeline, call = await self._prepare_call(input, PUBLISH_EVENTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.PUBLISH_EVENTS, [], plugins + ) return await pipeline.input_stream(call, PublishEventStream) async def subscribe_to_events( @@ -171,7 +171,7 @@ async def subscribe_to_events( An `OutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( - input, SUBSCRIBE_TO_EVENTS, [], plugins + input, _models.SUBSCRIBE_TO_EVENTS, [], plugins ) return await pipeline.output_stream( call, SubscribeEventStream, _SubscribeEventStreamDeserializer().deserialize @@ -198,7 +198,7 @@ async def trade_event_stream( A `DuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( - input, TRADE_EVENT_STREAM, [], plugins + input, _models.TRADE_EVENT_STREAM, [], plugins ) return await pipeline.duplex_stream( call, TradeEvents, TradeEvents, _TradeEventsDeserializer().deserialize diff --git a/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py b/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py index 45a366c86..67347e773 100644 --- a/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py +++ b/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py @@ -6,12 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - PUBLISH_EVENTS as _SCHEMA_PUBLISH_EVENTS, - SUBSCRIBE_TO_EVENTS as _SCHEMA_SUBSCRIBE_TO_EVENTS, - TRADE_EVENT_STREAM as _SCHEMA_TRADE_EVENT_STREAM, -) - class ServiceError(ModeledError): """ @@ -84,28 +78,43 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ("PUBLISH_EVENTS", "SUBSCRIBE_TO_EVENTS", "TRADE_EVENT_STREAM") +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -PUBLISH_EVENTS = APIOperation( - static_schema=_SCHEMA_PUBLISH_EVENTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) + + +_operation_data["PUBLISH_EVENTS"] = ("PUBLISH_EVENTS", (), ("smithy.api#noAuth",)) -SUBSCRIBE_TO_EVENTS = APIOperation( - static_schema=_SCHEMA_SUBSCRIBE_TO_EVENTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["SUBSCRIBE_TO_EVENTS"] = ( + "SUBSCRIBE_TO_EVENTS", + (), + ("smithy.api#noAuth",), ) -TRADE_EVENT_STREAM = APIOperation( - static_schema=_SCHEMA_TRADE_EVENT_STREAM, - model_registry=_registry, - error_ids=[ShapeID("smithy.python.tests.handwritten#StreamServiceError")], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["TRADE_EVENT_STREAM"] = ( + "TRADE_EVENT_STREAM", + ("smithy.python.tests.handwritten#StreamServiceError",), + ("smithy.api#noAuth",), ) diff --git a/codegen-output/rest-json-1/src/restjson/client.py b/codegen-output/rest-json-1/src/restjson/client.py index 2f96fe9e8..3a50e1d2c 100644 --- a/codegen-output/rest-json-1/src/restjson/client.py +++ b/codegen-output/rest-json-1/src/restjson/client.py @@ -22,136 +22,24 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncRestJsonProtocolConfig, Plugin from .models import ( - ALL_QUERY_STRING_TYPES, - CONSTANT_AND_VARIABLE_QUERY_STRING, - CONSTANT_QUERY_STRING, - CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS, - DOCUMENT_TYPE, - DOCUMENT_TYPE_AS_MAP_VALUE, - DOCUMENT_TYPE_AS_PAYLOAD, - DUPLEX_STREAM, - DUPLEX_STREAM_WITH_DISTINCT_STREAMS, - DUPLEX_STREAM_WITH_INITIAL_MESSAGES, DuplexStreamInput, DuplexStreamOutput, DuplexStreamWithDistinctStreamsInput, DuplexStreamWithDistinctStreamsOutput, DuplexStreamWithInitialMessagesInput, DuplexStreamWithInitialMessagesOutput, - EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, EventStream, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION, - HTTP_CHECKSUM_REQUIRED, - HTTP_EMPTY_PREFIX_HEADERS, - HTTP_ENUM_PAYLOAD, - HTTP_PAYLOAD_TRAITS, - HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - HTTP_PAYLOAD_WITH_STRUCTURE, - HTTP_PAYLOAD_WITH_UNION, - HTTP_PREFIX_HEADERS, - HTTP_PREFIX_HEADERS_IN_RESPONSE, - HTTP_QUERY_PARAMS_ONLY_OPERATION, - HTTP_REQUEST_WITH_FLOAT_LABELS, - HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - HTTP_REQUEST_WITH_LABELS, - HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - HTTP_REQUEST_WITH_REGEX_LITERAL, - HTTP_RESPONSE_CODE, - HTTP_STRING_PAYLOAD, - IGNORE_QUERY_PARAMS_IN_RESPONSE, - INPUT_AND_OUTPUT_WITH_HEADERS, - INPUT_STREAM, - INPUT_STREAM_WITH_INITIAL_REQUEST, InputStreamInput, InputStreamOutput, InputStreamWithInitialRequestInput, InputStreamWithInitialRequestOutput, - JSON_BLOBS, - JSON_ENUMS, - JSON_INT_ENUMS, - JSON_LISTS, - JSON_MAPS, - JSON_TIMESTAMPS, - JSON_UNIONS, - MALFORMED_ACCEPT_WITH_BODY, - MALFORMED_ACCEPT_WITH_GENERIC_STRING, - MALFORMED_ACCEPT_WITH_PAYLOAD, - MALFORMED_BLOB, - MALFORMED_BOOLEAN, - MALFORMED_BYTE, - MALFORMED_CONTENT_TYPE_WITHOUT_BODY, - MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT, - MALFORMED_CONTENT_TYPE_WITH_BODY, - MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING, - MALFORMED_CONTENT_TYPE_WITH_PAYLOAD, - MALFORMED_DOUBLE, - MALFORMED_FLOAT, - MALFORMED_INTEGER, - MALFORMED_LIST, - MALFORMED_LONG, - MALFORMED_MAP, - MALFORMED_REQUEST_BODY, - MALFORMED_SHORT, - MALFORMED_STRING, - MALFORMED_TIMESTAMP_BODY_DATE_TIME, - MALFORMED_TIMESTAMP_BODY_DEFAULT, - MALFORMED_TIMESTAMP_BODY_HTTP_DATE, - MALFORMED_TIMESTAMP_HEADER_DATE_TIME, - MALFORMED_TIMESTAMP_HEADER_DEFAULT, - MALFORMED_TIMESTAMP_HEADER_EPOCH, - MALFORMED_TIMESTAMP_PATH_DEFAULT, - MALFORMED_TIMESTAMP_PATH_EPOCH, - MALFORMED_TIMESTAMP_PATH_HTTP_DATE, - MALFORMED_TIMESTAMP_QUERY_DEFAULT, - MALFORMED_TIMESTAMP_QUERY_EPOCH, - MALFORMED_TIMESTAMP_QUERY_HTTP_DATE, - MALFORMED_UNION, - MEDIA_TYPE_HEADER, - NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT, - NULL_AND_EMPTY_HEADERS_CLIENT, - NULL_AND_EMPTY_HEADERS_SERVER, - OMITS_NULL_SERIALIZES_EMPTY_STRING, - OMITS_SERIALIZING_EMPTY_LISTS, - OPERATION_WITH_DEFAULTS, - OPERATION_WITH_NESTED_STRUCTURE, - OUTPUT_STREAM, - OUTPUT_STREAM_WITH_INITIAL_RESPONSE, OutputStreamInput, OutputStreamOutput, OutputStreamWithInitialResponseInput, OutputStreamWithInitialResponseOutput, - POST_PLAYER_ACTION, - POST_UNION_WITH_JSON_NAME, - PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_PARAMS_AS_STRING_LIST_MAP, - QUERY_PRECEDENCE, - RECURSIVE_SHAPES, - RESPONSE_CODE_HTTP_FALLBACK, - RESPONSE_CODE_REQUIRED, - SIMPLE_SCALAR_PROPERTIES, - SPARSE_JSON_LISTS, - SPARSE_JSON_MAPS, - STREAMING_TRAITS, - STREAMING_TRAITS_REQUIRE_LENGTH, - STREAMING_TRAITS_WITH_MEDIA_TYPE, - TEST_BODY_STRUCTURE, - TEST_GET_NO_INPUT_NO_PAYLOAD, - TEST_GET_NO_PAYLOAD, - TEST_PAYLOAD_BLOB, - TEST_PAYLOAD_STRUCTURE, - TEST_POST_NO_INPUT_NO_PAYLOAD, - TEST_POST_NO_PAYLOAD, - TIMESTAMP_FORMAT_HEADERS, - UNIT_INPUT_AND_OUTPUT, _EventStreamDeserializer, ) from .user_agent import aws_user_agent_plugin @@ -506,7 +394,7 @@ async def all_query_string_types( An instance of `AllQueryStringTypesOutput`. """ pipeline, call = await self._prepare_call( - input, ALL_QUERY_STRING_TYPES, [], plugins + input, _models.ALL_QUERY_STRING_TYPES, [], plugins ) return await pipeline(call) @@ -533,7 +421,7 @@ async def constant_and_variable_query_string( An instance of `ConstantAndVariableQueryStringOutput`. """ pipeline, call = await self._prepare_call( - input, CONSTANT_AND_VARIABLE_QUERY_STRING, [], plugins + input, _models.CONSTANT_AND_VARIABLE_QUERY_STRING, [], plugins ) return await pipeline(call) @@ -559,7 +447,7 @@ async def constant_query_string( An instance of `ConstantQueryStringOutput`. """ pipeline, call = await self._prepare_call( - input, CONSTANT_QUERY_STRING, [], plugins + input, _models.CONSTANT_QUERY_STRING, [], plugins ) return await pipeline(call) @@ -583,7 +471,7 @@ async def content_type_parameters( An instance of `ContentTypeParametersOutput`. """ pipeline, call = await self._prepare_call( - input, CONTENT_TYPE_PARAMETERS, [], plugins + input, _models.CONTENT_TYPE_PARAMETERS, [], plugins ) return await pipeline(call) @@ -605,7 +493,9 @@ async def datetime_offsets( Returns: An instance of `DatetimeOffsetsOutput`. """ - pipeline, call = await self._prepare_call(input, DATETIME_OFFSETS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DATETIME_OFFSETS, [], plugins + ) return await pipeline(call) async def document_type( @@ -626,7 +516,9 @@ async def document_type( Returns: An instance of `DocumentTypeOutput`. """ - pipeline, call = await self._prepare_call(input, DOCUMENT_TYPE, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DOCUMENT_TYPE, [], plugins + ) return await pipeline(call) async def document_type_as_map_value( @@ -648,7 +540,7 @@ async def document_type_as_map_value( An instance of `DocumentTypeAsMapValueOutput`. """ pipeline, call = await self._prepare_call( - input, DOCUMENT_TYPE_AS_MAP_VALUE, [], plugins + input, _models.DOCUMENT_TYPE_AS_MAP_VALUE, [], plugins ) return await pipeline(call) @@ -671,7 +563,7 @@ async def document_type_as_payload( An instance of `DocumentTypeAsPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, DOCUMENT_TYPE_AS_PAYLOAD, [], plugins + input, _models.DOCUMENT_TYPE_AS_PAYLOAD, [], plugins ) return await pipeline(call) @@ -693,7 +585,9 @@ async def duplex_stream( Returns: A `DuplexEventStream` for bidirectional streaming. """ - pipeline, call = await self._prepare_call(input, DUPLEX_STREAM, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DUPLEX_STREAM, [], plugins + ) return await pipeline.duplex_stream( call, EventStream, EventStream, _EventStreamDeserializer().deserialize ) @@ -719,7 +613,7 @@ async def duplex_stream_with_distinct_streams( An `InputEventStream` for client-to-server streaming. """ pipeline, call = await self._prepare_call( - input, DUPLEX_STREAM_WITH_DISTINCT_STREAMS, [], plugins + input, _models.DUPLEX_STREAM_WITH_DISTINCT_STREAMS, [], plugins ) return await pipeline.input_stream(call, EventStream) @@ -746,7 +640,7 @@ async def duplex_stream_with_initial_messages( A `DuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( - input, DUPLEX_STREAM_WITH_INITIAL_MESSAGES, [], plugins + input, _models.DUPLEX_STREAM_WITH_INITIAL_MESSAGES, [], plugins ) return await pipeline.duplex_stream( call, EventStream, EventStream, _EventStreamDeserializer().deserialize @@ -774,7 +668,7 @@ async def empty_input_and_empty_output( An instance of `EmptyInputAndEmptyOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins ) return await pipeline(call) @@ -797,7 +691,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -822,7 +716,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -845,7 +739,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -872,7 +766,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -895,7 +789,7 @@ async def host_with_path_operation( An instance of `HostWithPathOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HOST_WITH_PATH_OPERATION, [], plugins + input, _models.HOST_WITH_PATH_OPERATION, [], plugins ) return await pipeline(call) @@ -918,7 +812,7 @@ async def http_checksum_required( An instance of `HttpChecksumRequiredOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_CHECKSUM_REQUIRED, [], plugins + input, _models.HTTP_CHECKSUM_REQUIRED, [], plugins ) return await pipeline(call) @@ -941,7 +835,7 @@ async def http_empty_prefix_headers( An instance of `HttpEmptyPrefixHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_EMPTY_PREFIX_HEADERS, [], plugins + input, _models.HTTP_EMPTY_PREFIX_HEADERS, [], plugins ) return await pipeline(call) @@ -963,7 +857,9 @@ async def http_enum_payload( Returns: An instance of `HttpEnumPayloadOutput`. """ - pipeline, call = await self._prepare_call(input, HTTP_ENUM_PAYLOAD, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.HTTP_ENUM_PAYLOAD, [], plugins + ) return await pipeline(call) async def http_payload_traits( @@ -987,7 +883,7 @@ async def http_payload_traits( An instance of `HttpPayloadTraitsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_TRAITS, [], plugins + input, _models.HTTP_PAYLOAD_TRAITS, [], plugins ) return await pipeline(call) @@ -1013,7 +909,7 @@ async def http_payload_traits_with_media_type( An instance of `HttpPayloadTraitsWithMediaTypeOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, [], plugins + input, _models.HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, [], plugins ) return await pipeline(call) @@ -1038,7 +934,7 @@ async def http_payload_with_structure( An instance of `HttpPayloadWithStructureOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_STRUCTURE, [], plugins + input, _models.HTTP_PAYLOAD_WITH_STRUCTURE, [], plugins ) return await pipeline(call) @@ -1061,7 +957,7 @@ async def http_payload_with_union( An instance of `HttpPayloadWithUnionOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_UNION, [], plugins + input, _models.HTTP_PAYLOAD_WITH_UNION, [], plugins ) return await pipeline(call) @@ -1085,7 +981,7 @@ async def http_prefix_headers( An instance of `HttpPrefixHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PREFIX_HEADERS, [], plugins + input, _models.HTTP_PREFIX_HEADERS, [], plugins ) return await pipeline(call) @@ -1110,7 +1006,7 @@ async def http_prefix_headers_in_response( An instance of `HttpPrefixHeadersInResponseOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PREFIX_HEADERS_IN_RESPONSE, [], plugins + input, _models.HTTP_PREFIX_HEADERS_IN_RESPONSE, [], plugins ) return await pipeline(call) @@ -1135,7 +1031,7 @@ async def http_query_params_only_operation( An instance of `HttpQueryParamsOnlyOperationOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_QUERY_PARAMS_ONLY_OPERATION, [], plugins + input, _models.HTTP_QUERY_PARAMS_ONLY_OPERATION, [], plugins ) return await pipeline(call) @@ -1160,7 +1056,7 @@ async def http_request_with_float_labels( An instance of `HttpRequestWithFloatLabelsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_FLOAT_LABELS, [], plugins + input, _models.HTTP_REQUEST_WITH_FLOAT_LABELS, [], plugins ) return await pipeline(call) @@ -1185,7 +1081,7 @@ async def http_request_with_greedy_label_in_path( An instance of `HttpRequestWithGreedyLabelInPathOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, [], plugins + input, _models.HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, [], plugins ) return await pipeline(call) @@ -1209,7 +1105,7 @@ async def http_request_with_labels( An instance of `HttpRequestWithLabelsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_LABELS, [], plugins + input, _models.HTTP_REQUEST_WITH_LABELS, [], plugins ) return await pipeline(call) @@ -1235,7 +1131,7 @@ async def http_request_with_labels_and_timestamp_format( An instance of `HttpRequestWithLabelsAndTimestampFormatOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, [], plugins + input, _models.HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, [], plugins ) return await pipeline(call) @@ -1260,7 +1156,7 @@ async def http_request_with_regex_literal( An instance of `HttpRequestWithRegexLiteralOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_REGEX_LITERAL, [], plugins + input, _models.HTTP_REQUEST_WITH_REGEX_LITERAL, [], plugins ) return await pipeline(call) @@ -1283,7 +1179,7 @@ async def http_response_code( An instance of `HttpResponseCodeOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_RESPONSE_CODE, [], plugins + input, _models.HTTP_RESPONSE_CODE, [], plugins ) return await pipeline(call) @@ -1306,7 +1202,7 @@ async def http_string_payload( An instance of `HttpStringPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_STRING_PAYLOAD, [], plugins + input, _models.HTTP_STRING_PAYLOAD, [], plugins ) return await pipeline(call) @@ -1333,7 +1229,7 @@ async def ignore_query_params_in_response( An instance of `IgnoreQueryParamsInResponseOutput`. """ pipeline, call = await self._prepare_call( - input, IGNORE_QUERY_PARAMS_IN_RESPONSE, [], plugins + input, _models.IGNORE_QUERY_PARAMS_IN_RESPONSE, [], plugins ) return await pipeline(call) @@ -1357,7 +1253,7 @@ async def input_and_output_with_headers( An instance of `InputAndOutputWithHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, INPUT_AND_OUTPUT_WITH_HEADERS, [], plugins + input, _models.INPUT_AND_OUTPUT_WITH_HEADERS, [], plugins ) return await pipeline(call) @@ -1379,7 +1275,9 @@ async def input_stream( Returns: An `InputEventStream` for client-to-server streaming. """ - pipeline, call = await self._prepare_call(input, INPUT_STREAM, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.INPUT_STREAM, [], plugins + ) return await pipeline.input_stream(call, EventStream) async def input_stream_with_initial_request( @@ -1403,7 +1301,7 @@ async def input_stream_with_initial_request( An `InputEventStream` for client-to-server streaming. """ pipeline, call = await self._prepare_call( - input, INPUT_STREAM_WITH_INITIAL_REQUEST, [], plugins + input, _models.INPUT_STREAM_WITH_INITIAL_REQUEST, [], plugins ) return await pipeline.input_stream(call, EventStream) @@ -1425,7 +1323,9 @@ async def json_blobs( Returns: An instance of `JsonBlobsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_BLOBS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_BLOBS, [], plugins + ) return await pipeline(call) async def json_enums( @@ -1447,7 +1347,9 @@ async def json_enums( Returns: An instance of `JsonEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_ENUMS, [], plugins + ) return await pipeline(call) async def json_int_enums( @@ -1469,7 +1371,9 @@ async def json_int_enums( Returns: An instance of `JsonIntEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_INT_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_INT_ENUMS, [], plugins + ) return await pipeline(call) async def json_lists( @@ -1492,7 +1396,9 @@ async def json_lists( Returns: An instance of `JsonListsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_LISTS, [], plugins + ) return await pipeline(call) async def json_maps( @@ -1513,7 +1419,7 @@ async def json_maps( Returns: An instance of `JsonMapsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_MAPS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.JSON_MAPS, [], plugins) return await pipeline(call) async def json_timestamps( @@ -1535,7 +1441,9 @@ async def json_timestamps( Returns: An instance of `JsonTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_TIMESTAMPS, [], plugins + ) return await pipeline(call) async def json_unions( @@ -1556,7 +1464,9 @@ async def json_unions( Returns: An instance of `JsonUnionsOutput`. """ - pipeline, call = await self._prepare_call(input, JSON_UNIONS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.JSON_UNIONS, [], plugins + ) return await pipeline(call) async def malformed_accept_with_body( @@ -1578,7 +1488,7 @@ async def malformed_accept_with_body( An instance of `MalformedAcceptWithBodyOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_ACCEPT_WITH_BODY, [], plugins + input, _models.MALFORMED_ACCEPT_WITH_BODY, [], plugins ) return await pipeline(call) @@ -1603,7 +1513,7 @@ async def malformed_accept_with_generic_string( An instance of `MalformedAcceptWithGenericStringOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_ACCEPT_WITH_GENERIC_STRING, [], plugins + input, _models.MALFORMED_ACCEPT_WITH_GENERIC_STRING, [], plugins ) return await pipeline(call) @@ -1628,7 +1538,7 @@ async def malformed_accept_with_payload( An instance of `MalformedAcceptWithPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_ACCEPT_WITH_PAYLOAD, [], plugins + input, _models.MALFORMED_ACCEPT_WITH_PAYLOAD, [], plugins ) return await pipeline(call) @@ -1650,7 +1560,9 @@ async def malformed_blob( Returns: An instance of `MalformedBlobOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_BLOB, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_BLOB, [], plugins + ) return await pipeline(call) async def malformed_boolean( @@ -1671,7 +1583,9 @@ async def malformed_boolean( Returns: An instance of `MalformedBooleanOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_BOOLEAN, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_BOOLEAN, [], plugins + ) return await pipeline(call) async def malformed_byte( @@ -1692,7 +1606,9 @@ async def malformed_byte( Returns: An instance of `MalformedByteOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_BYTE, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_BYTE, [], plugins + ) return await pipeline(call) async def malformed_content_type_with_body( @@ -1716,7 +1632,7 @@ async def malformed_content_type_with_body( An instance of `MalformedContentTypeWithBodyOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_CONTENT_TYPE_WITH_BODY, [], plugins + input, _models.MALFORMED_CONTENT_TYPE_WITH_BODY, [], plugins ) return await pipeline(call) @@ -1741,7 +1657,7 @@ async def malformed_content_type_with_generic_string( An instance of `MalformedContentTypeWithGenericStringOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING, [], plugins + input, _models.MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING, [], plugins ) return await pipeline(call) @@ -1766,7 +1682,7 @@ async def malformed_content_type_without_body( An instance of `MalformedContentTypeWithoutBodyOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_CONTENT_TYPE_WITHOUT_BODY, [], plugins + input, _models.MALFORMED_CONTENT_TYPE_WITHOUT_BODY, [], plugins ) return await pipeline(call) @@ -1791,7 +1707,7 @@ async def malformed_content_type_without_body_empty_input( An instance of `MalformedContentTypeWithoutBodyEmptyInputOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT, [], plugins + input, _models.MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT, [], plugins ) return await pipeline(call) @@ -1816,7 +1732,7 @@ async def malformed_content_type_with_payload( An instance of `MalformedContentTypeWithPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_CONTENT_TYPE_WITH_PAYLOAD, [], plugins + input, _models.MALFORMED_CONTENT_TYPE_WITH_PAYLOAD, [], plugins ) return await pipeline(call) @@ -1838,7 +1754,9 @@ async def malformed_double( Returns: An instance of `MalformedDoubleOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_DOUBLE, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_DOUBLE, [], plugins + ) return await pipeline(call) async def malformed_float( @@ -1859,7 +1777,9 @@ async def malformed_float( Returns: An instance of `MalformedFloatOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_FLOAT, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_FLOAT, [], plugins + ) return await pipeline(call) async def malformed_integer( @@ -1880,7 +1800,9 @@ async def malformed_integer( Returns: An instance of `MalformedIntegerOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_INTEGER, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_INTEGER, [], plugins + ) return await pipeline(call) async def malformed_list( @@ -1901,7 +1823,9 @@ async def malformed_list( Returns: An instance of `MalformedListOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_LIST, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_LIST, [], plugins + ) return await pipeline(call) async def malformed_long( @@ -1922,7 +1846,9 @@ async def malformed_long( Returns: An instance of `MalformedLongOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_LONG, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_LONG, [], plugins + ) return await pipeline(call) async def malformed_map( @@ -1943,7 +1869,9 @@ async def malformed_map( Returns: An instance of `MalformedMapOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_MAP, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_MAP, [], plugins + ) return await pipeline(call) async def malformed_request_body( @@ -1965,7 +1893,7 @@ async def malformed_request_body( An instance of `MalformedRequestBodyOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_REQUEST_BODY, [], plugins + input, _models.MALFORMED_REQUEST_BODY, [], plugins ) return await pipeline(call) @@ -1987,7 +1915,9 @@ async def malformed_short( Returns: An instance of `MalformedShortOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_SHORT, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_SHORT, [], plugins + ) return await pipeline(call) async def malformed_string( @@ -2008,7 +1938,9 @@ async def malformed_string( Returns: An instance of `MalformedStringOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_STRING, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_STRING, [], plugins + ) return await pipeline(call) async def malformed_timestamp_body_date_time( @@ -2032,7 +1964,7 @@ async def malformed_timestamp_body_date_time( An instance of `MalformedTimestampBodyDateTimeOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_BODY_DATE_TIME, [], plugins + input, _models.MALFORMED_TIMESTAMP_BODY_DATE_TIME, [], plugins ) return await pipeline(call) @@ -2057,7 +1989,7 @@ async def malformed_timestamp_body_default( An instance of `MalformedTimestampBodyDefaultOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_BODY_DEFAULT, [], plugins + input, _models.MALFORMED_TIMESTAMP_BODY_DEFAULT, [], plugins ) return await pipeline(call) @@ -2082,7 +2014,7 @@ async def malformed_timestamp_body_http_date( An instance of `MalformedTimestampBodyHttpDateOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_BODY_HTTP_DATE, [], plugins + input, _models.MALFORMED_TIMESTAMP_BODY_HTTP_DATE, [], plugins ) return await pipeline(call) @@ -2107,7 +2039,7 @@ async def malformed_timestamp_header_date_time( An instance of `MalformedTimestampHeaderDateTimeOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_HEADER_DATE_TIME, [], plugins + input, _models.MALFORMED_TIMESTAMP_HEADER_DATE_TIME, [], plugins ) return await pipeline(call) @@ -2132,7 +2064,7 @@ async def malformed_timestamp_header_default( An instance of `MalformedTimestampHeaderDefaultOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_HEADER_DEFAULT, [], plugins + input, _models.MALFORMED_TIMESTAMP_HEADER_DEFAULT, [], plugins ) return await pipeline(call) @@ -2157,7 +2089,7 @@ async def malformed_timestamp_header_epoch( An instance of `MalformedTimestampHeaderEpochOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_HEADER_EPOCH, [], plugins + input, _models.MALFORMED_TIMESTAMP_HEADER_EPOCH, [], plugins ) return await pipeline(call) @@ -2182,7 +2114,7 @@ async def malformed_timestamp_path_default( An instance of `MalformedTimestampPathDefaultOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_PATH_DEFAULT, [], plugins + input, _models.MALFORMED_TIMESTAMP_PATH_DEFAULT, [], plugins ) return await pipeline(call) @@ -2207,7 +2139,7 @@ async def malformed_timestamp_path_epoch( An instance of `MalformedTimestampPathEpochOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_PATH_EPOCH, [], plugins + input, _models.MALFORMED_TIMESTAMP_PATH_EPOCH, [], plugins ) return await pipeline(call) @@ -2232,7 +2164,7 @@ async def malformed_timestamp_path_http_date( An instance of `MalformedTimestampPathHttpDateOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_PATH_HTTP_DATE, [], plugins + input, _models.MALFORMED_TIMESTAMP_PATH_HTTP_DATE, [], plugins ) return await pipeline(call) @@ -2257,7 +2189,7 @@ async def malformed_timestamp_query_default( An instance of `MalformedTimestampQueryDefaultOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_QUERY_DEFAULT, [], plugins + input, _models.MALFORMED_TIMESTAMP_QUERY_DEFAULT, [], plugins ) return await pipeline(call) @@ -2282,7 +2214,7 @@ async def malformed_timestamp_query_epoch( An instance of `MalformedTimestampQueryEpochOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_QUERY_EPOCH, [], plugins + input, _models.MALFORMED_TIMESTAMP_QUERY_EPOCH, [], plugins ) return await pipeline(call) @@ -2307,7 +2239,7 @@ async def malformed_timestamp_query_http_date( An instance of `MalformedTimestampQueryHttpDateOutput`. """ pipeline, call = await self._prepare_call( - input, MALFORMED_TIMESTAMP_QUERY_HTTP_DATE, [], plugins + input, _models.MALFORMED_TIMESTAMP_QUERY_HTTP_DATE, [], plugins ) return await pipeline(call) @@ -2329,7 +2261,9 @@ async def malformed_union( Returns: An instance of `MalformedUnionOutput`. """ - pipeline, call = await self._prepare_call(input, MALFORMED_UNION, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MALFORMED_UNION, [], plugins + ) return await pipeline(call) async def media_type_header( @@ -2351,7 +2285,9 @@ async def media_type_header( Returns: An instance of `MediaTypeHeaderOutput`. """ - pipeline, call = await self._prepare_call(input, MEDIA_TYPE_HEADER, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.MEDIA_TYPE_HEADER, [], plugins + ) return await pipeline(call) async def no_input_and_no_output( @@ -2376,7 +2312,7 @@ async def no_input_and_no_output( An instance of `NoInputAndNoOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_NO_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_NO_OUTPUT, [], plugins ) return await pipeline(call) @@ -2402,7 +2338,7 @@ async def no_input_and_output( An instance of `NoInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) @@ -2426,7 +2362,7 @@ async def null_and_empty_headers_client( An instance of `NullAndEmptyHeadersClientOutput`. """ pipeline, call = await self._prepare_call( - input, NULL_AND_EMPTY_HEADERS_CLIENT, [], plugins + input, _models.NULL_AND_EMPTY_HEADERS_CLIENT, [], plugins ) return await pipeline(call) @@ -2450,7 +2386,7 @@ async def null_and_empty_headers_server( An instance of `NullAndEmptyHeadersServerOutput`. """ pipeline, call = await self._prepare_call( - input, NULL_AND_EMPTY_HEADERS_SERVER, [], plugins + input, _models.NULL_AND_EMPTY_HEADERS_SERVER, [], plugins ) return await pipeline(call) @@ -2475,7 +2411,7 @@ async def omits_null_serializes_empty_string( An instance of `OmitsNullSerializesEmptyStringOutput`. """ pipeline, call = await self._prepare_call( - input, OMITS_NULL_SERIALIZES_EMPTY_STRING, [], plugins + input, _models.OMITS_NULL_SERIALIZES_EMPTY_STRING, [], plugins ) return await pipeline(call) @@ -2502,7 +2438,7 @@ async def omits_serializing_empty_lists( An instance of `OmitsSerializingEmptyListsOutput`. """ pipeline, call = await self._prepare_call( - input, OMITS_SERIALIZING_EMPTY_LISTS, [], plugins + input, _models.OMITS_SERIALIZING_EMPTY_LISTS, [], plugins ) return await pipeline(call) @@ -2525,7 +2461,7 @@ async def operation_with_defaults( An instance of `OperationWithDefaultsOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_DEFAULTS, [], plugins + input, _models.OPERATION_WITH_DEFAULTS, [], plugins ) return await pipeline(call) @@ -2550,7 +2486,7 @@ async def operation_with_nested_structure( An instance of `OperationWithNestedStructureOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_NESTED_STRUCTURE, [], plugins + input, _models.OPERATION_WITH_NESTED_STRUCTURE, [], plugins ) return await pipeline(call) @@ -2572,7 +2508,9 @@ async def output_stream( Returns: An `OutputEventStream` for server-to-client streaming. """ - pipeline, call = await self._prepare_call(input, OUTPUT_STREAM, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.OUTPUT_STREAM, [], plugins + ) return await pipeline.output_stream( call, EventStream, _EventStreamDeserializer().deserialize ) @@ -2598,7 +2536,7 @@ async def output_stream_with_initial_response( An `OutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( - input, OUTPUT_STREAM_WITH_INITIAL_RESPONSE, [], plugins + input, _models.OUTPUT_STREAM_WITH_INITIAL_RESPONSE, [], plugins ) return await pipeline.output_stream( call, EventStream, _EventStreamDeserializer().deserialize @@ -2623,7 +2561,7 @@ async def post_player_action( An instance of `PostPlayerActionOutput`. """ pipeline, call = await self._prepare_call( - input, POST_PLAYER_ACTION, [], plugins + input, _models.POST_PLAYER_ACTION, [], plugins ) return await pipeline(call) @@ -2646,7 +2584,7 @@ async def post_union_with_json_name( An instance of `PostUnionWithJsonNameOutput`. """ pipeline, call = await self._prepare_call( - input, POST_UNION_WITH_JSON_NAME, [], plugins + input, _models.POST_UNION_WITH_JSON_NAME, [], plugins ) return await pipeline(call) @@ -2669,7 +2607,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -2694,7 +2632,7 @@ async def query_idempotency_token_auto_fill( An instance of `QueryIdempotencyTokenAutoFillOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins + input, _models.QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins ) return await pipeline(call) @@ -2719,7 +2657,7 @@ async def query_params_as_string_list_map( An instance of `QueryParamsAsStringListMapOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_PARAMS_AS_STRING_LIST_MAP, [], plugins + input, _models.QUERY_PARAMS_AS_STRING_LIST_MAP, [], plugins ) return await pipeline(call) @@ -2741,7 +2679,9 @@ async def query_precedence( Returns: An instance of `QueryPrecedenceOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_PRECEDENCE, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_PRECEDENCE, [], plugins + ) return await pipeline(call) async def recursive_shapes( @@ -2762,7 +2702,9 @@ async def recursive_shapes( Returns: An instance of `RecursiveShapesOutput`. """ - pipeline, call = await self._prepare_call(input, RECURSIVE_SHAPES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.RECURSIVE_SHAPES, [], plugins + ) return await pipeline(call) async def response_code_http_fallback( @@ -2784,7 +2726,7 @@ async def response_code_http_fallback( An instance of `ResponseCodeHttpFallbackOutput`. """ pipeline, call = await self._prepare_call( - input, RESPONSE_CODE_HTTP_FALLBACK, [], plugins + input, _models.RESPONSE_CODE_HTTP_FALLBACK, [], plugins ) return await pipeline(call) @@ -2807,7 +2749,7 @@ async def response_code_required( An instance of `ResponseCodeRequiredOutput`. """ pipeline, call = await self._prepare_call( - input, RESPONSE_CODE_REQUIRED, [], plugins + input, _models.RESPONSE_CODE_REQUIRED, [], plugins ) return await pipeline(call) @@ -2830,7 +2772,7 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) @@ -2852,7 +2794,9 @@ async def sparse_json_lists( Returns: An instance of `SparseJsonListsOutput`. """ - pipeline, call = await self._prepare_call(input, SPARSE_JSON_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.SPARSE_JSON_LISTS, [], plugins + ) return await pipeline(call) async def sparse_json_maps( @@ -2873,7 +2817,9 @@ async def sparse_json_maps( Returns: An instance of `SparseJsonMapsOutput`. """ - pipeline, call = await self._prepare_call(input, SPARSE_JSON_MAPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.SPARSE_JSON_MAPS, [], plugins + ) return await pipeline(call) async def streaming_traits( @@ -2896,7 +2842,9 @@ async def streaming_traits( Returns: An instance of `StreamingTraitsOutput`. """ - pipeline, call = await self._prepare_call(input, STREAMING_TRAITS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.STREAMING_TRAITS, [], plugins + ) return await pipeline(call) async def streaming_traits_require_length( @@ -2922,7 +2870,7 @@ async def streaming_traits_require_length( An instance of `StreamingTraitsRequireLengthOutput`. """ pipeline, call = await self._prepare_call( - input, STREAMING_TRAITS_REQUIRE_LENGTH, [], plugins + input, _models.STREAMING_TRAITS_REQUIRE_LENGTH, [], plugins ) return await pipeline(call) @@ -2949,7 +2897,7 @@ async def streaming_traits_with_media_type( An instance of `StreamingTraitsWithMediaTypeOutput`. """ pipeline, call = await self._prepare_call( - input, STREAMING_TRAITS_WITH_MEDIA_TYPE, [], plugins + input, _models.STREAMING_TRAITS_WITH_MEDIA_TYPE, [], plugins ) return await pipeline(call) @@ -2974,7 +2922,7 @@ async def test_body_structure( An instance of `TestBodyStructureOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_BODY_STRUCTURE, [], plugins + input, _models.TEST_BODY_STRUCTURE, [], plugins ) return await pipeline(call) @@ -3000,7 +2948,7 @@ async def test_get_no_input_no_payload( An instance of `TestGetNoInputNoPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_GET_NO_INPUT_NO_PAYLOAD, [], plugins + input, _models.TEST_GET_NO_INPUT_NO_PAYLOAD, [], plugins ) return await pipeline(call) @@ -3026,7 +2974,7 @@ async def test_get_no_payload( An instance of `TestGetNoPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_GET_NO_PAYLOAD, [], plugins + input, _models.TEST_GET_NO_PAYLOAD, [], plugins ) return await pipeline(call) @@ -3052,7 +3000,9 @@ async def test_payload_blob( Returns: An instance of `TestPayloadBlobOutput`. """ - pipeline, call = await self._prepare_call(input, TEST_PAYLOAD_BLOB, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.TEST_PAYLOAD_BLOB, [], plugins + ) return await pipeline(call) async def test_payload_structure( @@ -3076,7 +3026,7 @@ async def test_payload_structure( An instance of `TestPayloadStructureOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_PAYLOAD_STRUCTURE, [], plugins + input, _models.TEST_PAYLOAD_STRUCTURE, [], plugins ) return await pipeline(call) @@ -3102,7 +3052,7 @@ async def test_post_no_input_no_payload( An instance of `TestPostNoInputNoPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_POST_NO_INPUT_NO_PAYLOAD, [], plugins + input, _models.TEST_POST_NO_INPUT_NO_PAYLOAD, [], plugins ) return await pipeline(call) @@ -3127,7 +3077,7 @@ async def test_post_no_payload( An instance of `TestPostNoPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, TEST_POST_NO_PAYLOAD, [], plugins + input, _models.TEST_POST_NO_PAYLOAD, [], plugins ) return await pipeline(call) @@ -3151,7 +3101,7 @@ async def timestamp_format_headers( An instance of `TimestampFormatHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, TIMESTAMP_FORMAT_HEADERS, [], plugins + input, _models.TIMESTAMP_FORMAT_HEADERS, [], plugins ) return await pipeline(call) @@ -3175,6 +3125,6 @@ async def unit_input_and_output( An instance of `UnitInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, UNIT_INPUT_AND_OUTPUT, [], plugins + input, _models.UNIT_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) diff --git a/codegen-output/rest-json-1/src/restjson/models.py b/codegen-output/rest-json-1/src/restjson/models.py index 713560882..c9bbc28cd 100644 --- a/codegen-output/rest-json-1/src/restjson/models.py +++ b/codegen-output/rest-json-1/src/restjson/models.py @@ -6,122 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - ALL_QUERY_STRING_TYPES as _SCHEMA_ALL_QUERY_STRING_TYPES, - CONSTANT_AND_VARIABLE_QUERY_STRING as _SCHEMA_CONSTANT_AND_VARIABLE_QUERY_STRING, - CONSTANT_QUERY_STRING as _SCHEMA_CONSTANT_QUERY_STRING, - CONTENT_TYPE_PARAMETERS as _SCHEMA_CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS as _SCHEMA_DATETIME_OFFSETS, - DOCUMENT_TYPE as _SCHEMA_DOCUMENT_TYPE, - DOCUMENT_TYPE_AS_MAP_VALUE as _SCHEMA_DOCUMENT_TYPE_AS_MAP_VALUE, - DOCUMENT_TYPE_AS_PAYLOAD as _SCHEMA_DOCUMENT_TYPE_AS_PAYLOAD, - DUPLEX_STREAM as _SCHEMA_DUPLEX_STREAM, - DUPLEX_STREAM_WITH_DISTINCT_STREAMS as _SCHEMA_DUPLEX_STREAM_WITH_DISTINCT_STREAMS, - DUPLEX_STREAM_WITH_INITIAL_MESSAGES as _SCHEMA_DUPLEX_STREAM_WITH_INITIAL_MESSAGES, - EMPTY_INPUT_AND_EMPTY_OUTPUT as _SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HOST_WITH_PATH_OPERATION as _SCHEMA_HOST_WITH_PATH_OPERATION, - HTTP_CHECKSUM_REQUIRED as _SCHEMA_HTTP_CHECKSUM_REQUIRED, - HTTP_EMPTY_PREFIX_HEADERS as _SCHEMA_HTTP_EMPTY_PREFIX_HEADERS, - HTTP_ENUM_PAYLOAD as _SCHEMA_HTTP_ENUM_PAYLOAD, - HTTP_PAYLOAD_TRAITS as _SCHEMA_HTTP_PAYLOAD_TRAITS, - HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE as _SCHEMA_HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - HTTP_PAYLOAD_WITH_STRUCTURE as _SCHEMA_HTTP_PAYLOAD_WITH_STRUCTURE, - HTTP_PAYLOAD_WITH_UNION as _SCHEMA_HTTP_PAYLOAD_WITH_UNION, - HTTP_PREFIX_HEADERS as _SCHEMA_HTTP_PREFIX_HEADERS, - HTTP_PREFIX_HEADERS_IN_RESPONSE as _SCHEMA_HTTP_PREFIX_HEADERS_IN_RESPONSE, - HTTP_QUERY_PARAMS_ONLY_OPERATION as _SCHEMA_HTTP_QUERY_PARAMS_ONLY_OPERATION, - HTTP_REQUEST_WITH_FLOAT_LABELS as _SCHEMA_HTTP_REQUEST_WITH_FLOAT_LABELS, - HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH as _SCHEMA_HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - HTTP_REQUEST_WITH_LABELS as _SCHEMA_HTTP_REQUEST_WITH_LABELS, - HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT as _SCHEMA_HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - HTTP_REQUEST_WITH_REGEX_LITERAL as _SCHEMA_HTTP_REQUEST_WITH_REGEX_LITERAL, - HTTP_RESPONSE_CODE as _SCHEMA_HTTP_RESPONSE_CODE, - HTTP_STRING_PAYLOAD as _SCHEMA_HTTP_STRING_PAYLOAD, - IGNORE_QUERY_PARAMS_IN_RESPONSE as _SCHEMA_IGNORE_QUERY_PARAMS_IN_RESPONSE, - INPUT_AND_OUTPUT_WITH_HEADERS as _SCHEMA_INPUT_AND_OUTPUT_WITH_HEADERS, - INPUT_STREAM as _SCHEMA_INPUT_STREAM, - INPUT_STREAM_WITH_INITIAL_REQUEST as _SCHEMA_INPUT_STREAM_WITH_INITIAL_REQUEST, - JSON_BLOBS as _SCHEMA_JSON_BLOBS, - JSON_ENUMS as _SCHEMA_JSON_ENUMS, - JSON_INT_ENUMS as _SCHEMA_JSON_INT_ENUMS, - JSON_LISTS as _SCHEMA_JSON_LISTS, - JSON_MAPS as _SCHEMA_JSON_MAPS, - JSON_TIMESTAMPS as _SCHEMA_JSON_TIMESTAMPS, - JSON_UNIONS as _SCHEMA_JSON_UNIONS, - MALFORMED_ACCEPT_WITH_BODY as _SCHEMA_MALFORMED_ACCEPT_WITH_BODY, - MALFORMED_ACCEPT_WITH_GENERIC_STRING as _SCHEMA_MALFORMED_ACCEPT_WITH_GENERIC_STRING, - MALFORMED_ACCEPT_WITH_PAYLOAD as _SCHEMA_MALFORMED_ACCEPT_WITH_PAYLOAD, - MALFORMED_BLOB as _SCHEMA_MALFORMED_BLOB, - MALFORMED_BOOLEAN as _SCHEMA_MALFORMED_BOOLEAN, - MALFORMED_BYTE as _SCHEMA_MALFORMED_BYTE, - MALFORMED_CONTENT_TYPE_WITHOUT_BODY as _SCHEMA_MALFORMED_CONTENT_TYPE_WITHOUT_BODY, - MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT as _SCHEMA_MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT, - MALFORMED_CONTENT_TYPE_WITH_BODY as _SCHEMA_MALFORMED_CONTENT_TYPE_WITH_BODY, - MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING as _SCHEMA_MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING, - MALFORMED_CONTENT_TYPE_WITH_PAYLOAD as _SCHEMA_MALFORMED_CONTENT_TYPE_WITH_PAYLOAD, - MALFORMED_DOUBLE as _SCHEMA_MALFORMED_DOUBLE, - MALFORMED_FLOAT as _SCHEMA_MALFORMED_FLOAT, - MALFORMED_INTEGER as _SCHEMA_MALFORMED_INTEGER, - MALFORMED_LIST as _SCHEMA_MALFORMED_LIST, - MALFORMED_LONG as _SCHEMA_MALFORMED_LONG, - MALFORMED_MAP as _SCHEMA_MALFORMED_MAP, - MALFORMED_REQUEST_BODY as _SCHEMA_MALFORMED_REQUEST_BODY, - MALFORMED_SHORT as _SCHEMA_MALFORMED_SHORT, - MALFORMED_STRING as _SCHEMA_MALFORMED_STRING, - MALFORMED_TIMESTAMP_BODY_DATE_TIME as _SCHEMA_MALFORMED_TIMESTAMP_BODY_DATE_TIME, - MALFORMED_TIMESTAMP_BODY_DEFAULT as _SCHEMA_MALFORMED_TIMESTAMP_BODY_DEFAULT, - MALFORMED_TIMESTAMP_BODY_HTTP_DATE as _SCHEMA_MALFORMED_TIMESTAMP_BODY_HTTP_DATE, - MALFORMED_TIMESTAMP_HEADER_DATE_TIME as _SCHEMA_MALFORMED_TIMESTAMP_HEADER_DATE_TIME, - MALFORMED_TIMESTAMP_HEADER_DEFAULT as _SCHEMA_MALFORMED_TIMESTAMP_HEADER_DEFAULT, - MALFORMED_TIMESTAMP_HEADER_EPOCH as _SCHEMA_MALFORMED_TIMESTAMP_HEADER_EPOCH, - MALFORMED_TIMESTAMP_PATH_DEFAULT as _SCHEMA_MALFORMED_TIMESTAMP_PATH_DEFAULT, - MALFORMED_TIMESTAMP_PATH_EPOCH as _SCHEMA_MALFORMED_TIMESTAMP_PATH_EPOCH, - MALFORMED_TIMESTAMP_PATH_HTTP_DATE as _SCHEMA_MALFORMED_TIMESTAMP_PATH_HTTP_DATE, - MALFORMED_TIMESTAMP_QUERY_DEFAULT as _SCHEMA_MALFORMED_TIMESTAMP_QUERY_DEFAULT, - MALFORMED_TIMESTAMP_QUERY_EPOCH as _SCHEMA_MALFORMED_TIMESTAMP_QUERY_EPOCH, - MALFORMED_TIMESTAMP_QUERY_HTTP_DATE as _SCHEMA_MALFORMED_TIMESTAMP_QUERY_HTTP_DATE, - MALFORMED_UNION as _SCHEMA_MALFORMED_UNION, - MEDIA_TYPE_HEADER as _SCHEMA_MEDIA_TYPE_HEADER, - NO_INPUT_AND_NO_OUTPUT as _SCHEMA_NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT as _SCHEMA_NO_INPUT_AND_OUTPUT, - NULL_AND_EMPTY_HEADERS_CLIENT as _SCHEMA_NULL_AND_EMPTY_HEADERS_CLIENT, - NULL_AND_EMPTY_HEADERS_SERVER as _SCHEMA_NULL_AND_EMPTY_HEADERS_SERVER, - OMITS_NULL_SERIALIZES_EMPTY_STRING as _SCHEMA_OMITS_NULL_SERIALIZES_EMPTY_STRING, - OMITS_SERIALIZING_EMPTY_LISTS as _SCHEMA_OMITS_SERIALIZING_EMPTY_LISTS, - OPERATION_WITH_DEFAULTS as _SCHEMA_OPERATION_WITH_DEFAULTS, - OPERATION_WITH_NESTED_STRUCTURE as _SCHEMA_OPERATION_WITH_NESTED_STRUCTURE, - OUTPUT_STREAM as _SCHEMA_OUTPUT_STREAM, - OUTPUT_STREAM_WITH_INITIAL_RESPONSE as _SCHEMA_OUTPUT_STREAM_WITH_INITIAL_RESPONSE, - POST_PLAYER_ACTION as _SCHEMA_POST_PLAYER_ACTION, - POST_UNION_WITH_JSON_NAME as _SCHEMA_POST_UNION_WITH_JSON_NAME, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL as _SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_PARAMS_AS_STRING_LIST_MAP as _SCHEMA_QUERY_PARAMS_AS_STRING_LIST_MAP, - QUERY_PRECEDENCE as _SCHEMA_QUERY_PRECEDENCE, - RECURSIVE_SHAPES as _SCHEMA_RECURSIVE_SHAPES, - RESPONSE_CODE_HTTP_FALLBACK as _SCHEMA_RESPONSE_CODE_HTTP_FALLBACK, - RESPONSE_CODE_REQUIRED as _SCHEMA_RESPONSE_CODE_REQUIRED, - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, - SPARSE_JSON_LISTS as _SCHEMA_SPARSE_JSON_LISTS, - SPARSE_JSON_MAPS as _SCHEMA_SPARSE_JSON_MAPS, - STREAMING_TRAITS as _SCHEMA_STREAMING_TRAITS, - STREAMING_TRAITS_REQUIRE_LENGTH as _SCHEMA_STREAMING_TRAITS_REQUIRE_LENGTH, - STREAMING_TRAITS_WITH_MEDIA_TYPE as _SCHEMA_STREAMING_TRAITS_WITH_MEDIA_TYPE, - TEST_BODY_STRUCTURE as _SCHEMA_TEST_BODY_STRUCTURE, - TEST_GET_NO_INPUT_NO_PAYLOAD as _SCHEMA_TEST_GET_NO_INPUT_NO_PAYLOAD, - TEST_GET_NO_PAYLOAD as _SCHEMA_TEST_GET_NO_PAYLOAD, - TEST_PAYLOAD_BLOB as _SCHEMA_TEST_PAYLOAD_BLOB, - TEST_PAYLOAD_STRUCTURE as _SCHEMA_TEST_PAYLOAD_STRUCTURE, - TEST_POST_NO_INPUT_NO_PAYLOAD as _SCHEMA_TEST_POST_NO_INPUT_NO_PAYLOAD, - TEST_POST_NO_PAYLOAD as _SCHEMA_TEST_POST_NO_PAYLOAD, - TIMESTAMP_FORMAT_HEADERS as _SCHEMA_TIMESTAMP_FORMAT_HEADERS, - UNIT_INPUT_AND_OUTPUT as _SCHEMA_UNIT_INPUT_AND_OUTPUT, -) - class ServiceError(ModeledError): """ @@ -716,802 +600,685 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "ALL_QUERY_STRING_TYPES", + "CONSTANT_AND_VARIABLE_QUERY_STRING", + "CONSTANT_QUERY_STRING", + "CONTENT_TYPE_PARAMETERS", + "DATETIME_OFFSETS", + "DOCUMENT_TYPE", + "DOCUMENT_TYPE_AS_MAP_VALUE", + "DOCUMENT_TYPE_AS_PAYLOAD", + "DUPLEX_STREAM", + "DUPLEX_STREAM_WITH_DISTINCT_STREAMS", + "DUPLEX_STREAM_WITH_INITIAL_MESSAGES", + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "HOST_WITH_PATH_OPERATION", + "HTTP_CHECKSUM_REQUIRED", + "HTTP_EMPTY_PREFIX_HEADERS", + "HTTP_ENUM_PAYLOAD", + "HTTP_PAYLOAD_TRAITS", + "HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE", + "HTTP_PAYLOAD_WITH_STRUCTURE", + "HTTP_PAYLOAD_WITH_UNION", + "HTTP_PREFIX_HEADERS", + "HTTP_PREFIX_HEADERS_IN_RESPONSE", + "HTTP_QUERY_PARAMS_ONLY_OPERATION", + "HTTP_REQUEST_WITH_FLOAT_LABELS", + "HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH", + "HTTP_REQUEST_WITH_LABELS", + "HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT", + "HTTP_REQUEST_WITH_REGEX_LITERAL", + "HTTP_RESPONSE_CODE", + "HTTP_STRING_PAYLOAD", + "IGNORE_QUERY_PARAMS_IN_RESPONSE", + "INPUT_AND_OUTPUT_WITH_HEADERS", + "INPUT_STREAM", + "INPUT_STREAM_WITH_INITIAL_REQUEST", + "JSON_BLOBS", + "JSON_ENUMS", + "JSON_INT_ENUMS", + "JSON_LISTS", + "JSON_MAPS", + "JSON_TIMESTAMPS", + "JSON_UNIONS", + "MALFORMED_ACCEPT_WITH_BODY", + "MALFORMED_ACCEPT_WITH_GENERIC_STRING", + "MALFORMED_ACCEPT_WITH_PAYLOAD", + "MALFORMED_BLOB", + "MALFORMED_BOOLEAN", + "MALFORMED_BYTE", + "MALFORMED_CONTENT_TYPE_WITH_BODY", + "MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING", + "MALFORMED_CONTENT_TYPE_WITHOUT_BODY", + "MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT", + "MALFORMED_CONTENT_TYPE_WITH_PAYLOAD", + "MALFORMED_DOUBLE", + "MALFORMED_FLOAT", + "MALFORMED_INTEGER", + "MALFORMED_LIST", + "MALFORMED_LONG", + "MALFORMED_MAP", + "MALFORMED_REQUEST_BODY", + "MALFORMED_SHORT", + "MALFORMED_STRING", + "MALFORMED_TIMESTAMP_BODY_DATE_TIME", + "MALFORMED_TIMESTAMP_BODY_DEFAULT", + "MALFORMED_TIMESTAMP_BODY_HTTP_DATE", + "MALFORMED_TIMESTAMP_HEADER_DATE_TIME", + "MALFORMED_TIMESTAMP_HEADER_DEFAULT", + "MALFORMED_TIMESTAMP_HEADER_EPOCH", + "MALFORMED_TIMESTAMP_PATH_DEFAULT", + "MALFORMED_TIMESTAMP_PATH_EPOCH", + "MALFORMED_TIMESTAMP_PATH_HTTP_DATE", + "MALFORMED_TIMESTAMP_QUERY_DEFAULT", + "MALFORMED_TIMESTAMP_QUERY_EPOCH", + "MALFORMED_TIMESTAMP_QUERY_HTTP_DATE", + "MALFORMED_UNION", + "MEDIA_TYPE_HEADER", + "NO_INPUT_AND_NO_OUTPUT", + "NO_INPUT_AND_OUTPUT", + "NULL_AND_EMPTY_HEADERS_CLIENT", + "NULL_AND_EMPTY_HEADERS_SERVER", + "OMITS_NULL_SERIALIZES_EMPTY_STRING", + "OMITS_SERIALIZING_EMPTY_LISTS", + "OPERATION_WITH_DEFAULTS", + "OPERATION_WITH_NESTED_STRUCTURE", + "OUTPUT_STREAM", + "OUTPUT_STREAM_WITH_INITIAL_RESPONSE", + "POST_PLAYER_ACTION", + "POST_UNION_WITH_JSON_NAME", + "PUT_WITH_CONTENT_ENCODING", + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + "QUERY_PARAMS_AS_STRING_LIST_MAP", + "QUERY_PRECEDENCE", + "RECURSIVE_SHAPES", + "RESPONSE_CODE_HTTP_FALLBACK", + "RESPONSE_CODE_REQUIRED", + "SIMPLE_SCALAR_PROPERTIES", + "SPARSE_JSON_LISTS", + "SPARSE_JSON_MAPS", + "STREAMING_TRAITS", + "STREAMING_TRAITS_REQUIRE_LENGTH", + "STREAMING_TRAITS_WITH_MEDIA_TYPE", + "TEST_BODY_STRUCTURE", + "TEST_GET_NO_INPUT_NO_PAYLOAD", + "TEST_GET_NO_PAYLOAD", + "TEST_PAYLOAD_BLOB", + "TEST_PAYLOAD_STRUCTURE", + "TEST_POST_NO_INPUT_NO_PAYLOAD", + "TEST_POST_NO_PAYLOAD", + "TIMESTAMP_FORMAT_HEADERS", + "UNIT_INPUT_AND_OUTPUT", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -ALL_QUERY_STRING_TYPES = APIOperation( - static_schema=_SCHEMA_ALL_QUERY_STRING_TYPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -CONSTANT_AND_VARIABLE_QUERY_STRING = APIOperation( - static_schema=_SCHEMA_CONSTANT_AND_VARIABLE_QUERY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -CONSTANT_QUERY_STRING = APIOperation( - static_schema=_SCHEMA_CONSTANT_QUERY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ALL_QUERY_STRING_TYPES"] = ( + "ALL_QUERY_STRING_TYPES", + (), + ("aws.auth#sigv4",), ) -CONTENT_TYPE_PARAMETERS = APIOperation( - static_schema=_SCHEMA_CONTENT_TYPE_PARAMETERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONSTANT_AND_VARIABLE_QUERY_STRING"] = ( + "CONSTANT_AND_VARIABLE_QUERY_STRING", + (), + ("aws.auth#sigv4",), ) -DATETIME_OFFSETS = APIOperation( - static_schema=_SCHEMA_DATETIME_OFFSETS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONSTANT_QUERY_STRING"] = ( + "CONSTANT_QUERY_STRING", + (), + ("aws.auth#sigv4",), ) -DOCUMENT_TYPE = APIOperation( - static_schema=_SCHEMA_DOCUMENT_TYPE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONTENT_TYPE_PARAMETERS"] = ( + "CONTENT_TYPE_PARAMETERS", + (), + ("aws.auth#sigv4",), ) -DOCUMENT_TYPE_AS_MAP_VALUE = APIOperation( - static_schema=_SCHEMA_DOCUMENT_TYPE_AS_MAP_VALUE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DATETIME_OFFSETS"] = ("DATETIME_OFFSETS", (), ("aws.auth#sigv4",)) -DOCUMENT_TYPE_AS_PAYLOAD = APIOperation( - static_schema=_SCHEMA_DOCUMENT_TYPE_AS_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DOCUMENT_TYPE"] = ("DOCUMENT_TYPE", (), ("aws.auth#sigv4",)) -DUPLEX_STREAM = APIOperation( - static_schema=_SCHEMA_DUPLEX_STREAM, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["DOCUMENT_TYPE_AS_MAP_VALUE"] = ( + "DOCUMENT_TYPE_AS_MAP_VALUE", + (), + ("aws.auth#sigv4",), ) -DUPLEX_STREAM_WITH_DISTINCT_STREAMS = APIOperation( - static_schema=_SCHEMA_DUPLEX_STREAM_WITH_DISTINCT_STREAMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["DOCUMENT_TYPE_AS_PAYLOAD"] = ( + "DOCUMENT_TYPE_AS_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -DUPLEX_STREAM_WITH_INITIAL_MESSAGES = APIOperation( - static_schema=_SCHEMA_DUPLEX_STREAM_WITH_INITIAL_MESSAGES, - model_registry=_registry, - error_ids=[ShapeID("aws.protocoltests.restjson#ServiceUnavailableError")], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DUPLEX_STREAM"] = ("DUPLEX_STREAM", (), ("aws.auth#sigv4",)) -EMPTY_INPUT_AND_EMPTY_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["DUPLEX_STREAM_WITH_DISTINCT_STREAMS"] = ( + "DUPLEX_STREAM_WITH_DISTINCT_STREAMS", + (), + ("aws.auth#sigv4",), ) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["DUPLEX_STREAM_WITH_INITIAL_MESSAGES"] = ( + "DUPLEX_STREAM_WITH_INITIAL_MESSAGES", + ("aws.protocoltests.restjson#ServiceUnavailableError",), + ("aws.auth#sigv4",), ) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["EMPTY_INPUT_AND_EMPTY_OUTPUT"] = ( + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + (), + ("aws.auth#sigv4",), ) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.restjson#InvalidGreeting"), - ShapeID("aws.protocoltests.restjson#ComplexError"), - ShapeID("aws.protocoltests.restjson#FooError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -HOST_WITH_PATH_OPERATION = APIOperation( - static_schema=_SCHEMA_HOST_WITH_PATH_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FRACTIONAL_SECONDS"] = ("FRACTIONAL_SECONDS", (), ("aws.auth#sigv4",)) -HTTP_CHECKSUM_REQUIRED = APIOperation( - static_schema=_SCHEMA_HTTP_CHECKSUM_REQUIRED, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "aws.protocoltests.restjson#InvalidGreeting", + "aws.protocoltests.restjson#ComplexError", + "aws.protocoltests.restjson#FooError", + ), + ("aws.auth#sigv4",), ) -HTTP_EMPTY_PREFIX_HEADERS = APIOperation( - static_schema=_SCHEMA_HTTP_EMPTY_PREFIX_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HOST_WITH_PATH_OPERATION"] = ( + "HOST_WITH_PATH_OPERATION", + (), + ("aws.auth#sigv4",), ) -HTTP_ENUM_PAYLOAD = APIOperation( - static_schema=_SCHEMA_HTTP_ENUM_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_CHECKSUM_REQUIRED"] = ( + "HTTP_CHECKSUM_REQUIRED", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_TRAITS = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_TRAITS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_EMPTY_PREFIX_HEADERS"] = ( + "HTTP_EMPTY_PREFIX_HEADERS", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["HTTP_ENUM_PAYLOAD"] = ("HTTP_ENUM_PAYLOAD", (), ("aws.auth#sigv4",)) -HTTP_PAYLOAD_WITH_STRUCTURE = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_TRAITS"] = ( + "HTTP_PAYLOAD_TRAITS", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_UNION = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_UNION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE"] = ( + "HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE", + (), + ("aws.auth#sigv4",), ) -HTTP_PREFIX_HEADERS = APIOperation( - static_schema=_SCHEMA_HTTP_PREFIX_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_STRUCTURE"] = ( + "HTTP_PAYLOAD_WITH_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -HTTP_PREFIX_HEADERS_IN_RESPONSE = APIOperation( - static_schema=_SCHEMA_HTTP_PREFIX_HEADERS_IN_RESPONSE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_UNION"] = ( + "HTTP_PAYLOAD_WITH_UNION", + (), + ("aws.auth#sigv4",), ) -HTTP_QUERY_PARAMS_ONLY_OPERATION = APIOperation( - static_schema=_SCHEMA_HTTP_QUERY_PARAMS_ONLY_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PREFIX_HEADERS"] = ( + "HTTP_PREFIX_HEADERS", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_FLOAT_LABELS = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_FLOAT_LABELS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PREFIX_HEADERS_IN_RESPONSE"] = ( + "HTTP_PREFIX_HEADERS_IN_RESPONSE", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_QUERY_PARAMS_ONLY_OPERATION"] = ( + "HTTP_QUERY_PARAMS_ONLY_OPERATION", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_LABELS = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_LABELS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_FLOAT_LABELS"] = ( + "HTTP_REQUEST_WITH_FLOAT_LABELS", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH"] = ( + "HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_REGEX_LITERAL = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_REGEX_LITERAL, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_LABELS"] = ( + "HTTP_REQUEST_WITH_LABELS", + (), + ("aws.auth#sigv4",), ) -HTTP_RESPONSE_CODE = APIOperation( - static_schema=_SCHEMA_HTTP_RESPONSE_CODE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT"] = ( + "HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT", + (), + ("aws.auth#sigv4",), ) -HTTP_STRING_PAYLOAD = APIOperation( - static_schema=_SCHEMA_HTTP_STRING_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_REGEX_LITERAL"] = ( + "HTTP_REQUEST_WITH_REGEX_LITERAL", + (), + ("aws.auth#sigv4",), ) -IGNORE_QUERY_PARAMS_IN_RESPONSE = APIOperation( - static_schema=_SCHEMA_IGNORE_QUERY_PARAMS_IN_RESPONSE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["HTTP_RESPONSE_CODE"] = ("HTTP_RESPONSE_CODE", (), ("aws.auth#sigv4",)) -INPUT_AND_OUTPUT_WITH_HEADERS = APIOperation( - static_schema=_SCHEMA_INPUT_AND_OUTPUT_WITH_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_STRING_PAYLOAD"] = ( + "HTTP_STRING_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -INPUT_STREAM = APIOperation( - static_schema=_SCHEMA_INPUT_STREAM, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["IGNORE_QUERY_PARAMS_IN_RESPONSE"] = ( + "IGNORE_QUERY_PARAMS_IN_RESPONSE", + (), + ("aws.auth#sigv4",), ) -INPUT_STREAM_WITH_INITIAL_REQUEST = APIOperation( - static_schema=_SCHEMA_INPUT_STREAM_WITH_INITIAL_REQUEST, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["INPUT_AND_OUTPUT_WITH_HEADERS"] = ( + "INPUT_AND_OUTPUT_WITH_HEADERS", + (), + ("aws.auth#sigv4",), ) -JSON_BLOBS = APIOperation( - static_schema=_SCHEMA_JSON_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["INPUT_STREAM"] = ("INPUT_STREAM", (), ("aws.auth#sigv4",)) -JSON_ENUMS = APIOperation( - static_schema=_SCHEMA_JSON_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["INPUT_STREAM_WITH_INITIAL_REQUEST"] = ( + "INPUT_STREAM_WITH_INITIAL_REQUEST", + (), + ("aws.auth#sigv4",), ) -JSON_INT_ENUMS = APIOperation( - static_schema=_SCHEMA_JSON_INT_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_BLOBS"] = ("JSON_BLOBS", (), ("aws.auth#sigv4",)) -JSON_LISTS = APIOperation( - static_schema=_SCHEMA_JSON_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_ENUMS"] = ("JSON_ENUMS", (), ("aws.auth#sigv4",)) -JSON_MAPS = APIOperation( - static_schema=_SCHEMA_JSON_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_INT_ENUMS"] = ("JSON_INT_ENUMS", (), ("aws.auth#sigv4",)) -JSON_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_JSON_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_LISTS"] = ("JSON_LISTS", (), ("aws.auth#sigv4",)) -JSON_UNIONS = APIOperation( - static_schema=_SCHEMA_JSON_UNIONS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_MAPS"] = ("JSON_MAPS", (), ("aws.auth#sigv4",)) -MALFORMED_ACCEPT_WITH_BODY = APIOperation( - static_schema=_SCHEMA_MALFORMED_ACCEPT_WITH_BODY, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_TIMESTAMPS"] = ("JSON_TIMESTAMPS", (), ("aws.auth#sigv4",)) -MALFORMED_ACCEPT_WITH_GENERIC_STRING = APIOperation( - static_schema=_SCHEMA_MALFORMED_ACCEPT_WITH_GENERIC_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["JSON_UNIONS"] = ("JSON_UNIONS", (), ("aws.auth#sigv4",)) -MALFORMED_ACCEPT_WITH_PAYLOAD = APIOperation( - static_schema=_SCHEMA_MALFORMED_ACCEPT_WITH_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_ACCEPT_WITH_BODY"] = ( + "MALFORMED_ACCEPT_WITH_BODY", + (), + ("aws.auth#sigv4",), ) -MALFORMED_BLOB = APIOperation( - static_schema=_SCHEMA_MALFORMED_BLOB, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_ACCEPT_WITH_GENERIC_STRING"] = ( + "MALFORMED_ACCEPT_WITH_GENERIC_STRING", + (), + ("aws.auth#sigv4",), ) -MALFORMED_BOOLEAN = APIOperation( - static_schema=_SCHEMA_MALFORMED_BOOLEAN, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_ACCEPT_WITH_PAYLOAD"] = ( + "MALFORMED_ACCEPT_WITH_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -MALFORMED_BYTE = APIOperation( - static_schema=_SCHEMA_MALFORMED_BYTE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_BLOB"] = ("MALFORMED_BLOB", (), ("aws.auth#sigv4",)) -MALFORMED_CONTENT_TYPE_WITH_BODY = APIOperation( - static_schema=_SCHEMA_MALFORMED_CONTENT_TYPE_WITH_BODY, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_BOOLEAN"] = ("MALFORMED_BOOLEAN", (), ("aws.auth#sigv4",)) -MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING = APIOperation( - static_schema=_SCHEMA_MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_BYTE"] = ("MALFORMED_BYTE", (), ("aws.auth#sigv4",)) -MALFORMED_CONTENT_TYPE_WITHOUT_BODY = APIOperation( - static_schema=_SCHEMA_MALFORMED_CONTENT_TYPE_WITHOUT_BODY, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_CONTENT_TYPE_WITH_BODY"] = ( + "MALFORMED_CONTENT_TYPE_WITH_BODY", + (), + ("aws.auth#sigv4",), ) -MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT = APIOperation( - static_schema=_SCHEMA_MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING"] = ( + "MALFORMED_CONTENT_TYPE_WITH_GENERIC_STRING", + (), + ("aws.auth#sigv4",), ) -MALFORMED_CONTENT_TYPE_WITH_PAYLOAD = APIOperation( - static_schema=_SCHEMA_MALFORMED_CONTENT_TYPE_WITH_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_CONTENT_TYPE_WITHOUT_BODY"] = ( + "MALFORMED_CONTENT_TYPE_WITHOUT_BODY", + (), + ("aws.auth#sigv4",), ) -MALFORMED_DOUBLE = APIOperation( - static_schema=_SCHEMA_MALFORMED_DOUBLE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT"] = ( + "MALFORMED_CONTENT_TYPE_WITHOUT_BODY_EMPTY_INPUT", + (), + ("aws.auth#sigv4",), ) -MALFORMED_FLOAT = APIOperation( - static_schema=_SCHEMA_MALFORMED_FLOAT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_CONTENT_TYPE_WITH_PAYLOAD"] = ( + "MALFORMED_CONTENT_TYPE_WITH_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -MALFORMED_INTEGER = APIOperation( - static_schema=_SCHEMA_MALFORMED_INTEGER, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_DOUBLE"] = ("MALFORMED_DOUBLE", (), ("aws.auth#sigv4",)) -MALFORMED_LIST = APIOperation( - static_schema=_SCHEMA_MALFORMED_LIST, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_FLOAT"] = ("MALFORMED_FLOAT", (), ("aws.auth#sigv4",)) -MALFORMED_LONG = APIOperation( - static_schema=_SCHEMA_MALFORMED_LONG, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_INTEGER"] = ("MALFORMED_INTEGER", (), ("aws.auth#sigv4",)) -MALFORMED_MAP = APIOperation( - static_schema=_SCHEMA_MALFORMED_MAP, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_LIST"] = ("MALFORMED_LIST", (), ("aws.auth#sigv4",)) -MALFORMED_REQUEST_BODY = APIOperation( - static_schema=_SCHEMA_MALFORMED_REQUEST_BODY, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_LONG"] = ("MALFORMED_LONG", (), ("aws.auth#sigv4",)) -MALFORMED_SHORT = APIOperation( - static_schema=_SCHEMA_MALFORMED_SHORT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_MAP"] = ("MALFORMED_MAP", (), ("aws.auth#sigv4",)) -MALFORMED_STRING = APIOperation( - static_schema=_SCHEMA_MALFORMED_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_REQUEST_BODY"] = ( + "MALFORMED_REQUEST_BODY", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_BODY_DATE_TIME = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_BODY_DATE_TIME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_SHORT"] = ("MALFORMED_SHORT", (), ("aws.auth#sigv4",)) -MALFORMED_TIMESTAMP_BODY_DEFAULT = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_BODY_DEFAULT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_STRING"] = ("MALFORMED_STRING", (), ("aws.auth#sigv4",)) -MALFORMED_TIMESTAMP_BODY_HTTP_DATE = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_BODY_HTTP_DATE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_BODY_DATE_TIME"] = ( + "MALFORMED_TIMESTAMP_BODY_DATE_TIME", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_HEADER_DATE_TIME = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_HEADER_DATE_TIME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_BODY_DEFAULT"] = ( + "MALFORMED_TIMESTAMP_BODY_DEFAULT", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_HEADER_DEFAULT = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_HEADER_DEFAULT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_BODY_HTTP_DATE"] = ( + "MALFORMED_TIMESTAMP_BODY_HTTP_DATE", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_HEADER_EPOCH = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_HEADER_EPOCH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_HEADER_DATE_TIME"] = ( + "MALFORMED_TIMESTAMP_HEADER_DATE_TIME", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_PATH_DEFAULT = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_PATH_DEFAULT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_HEADER_DEFAULT"] = ( + "MALFORMED_TIMESTAMP_HEADER_DEFAULT", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_PATH_EPOCH = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_PATH_EPOCH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_HEADER_EPOCH"] = ( + "MALFORMED_TIMESTAMP_HEADER_EPOCH", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_PATH_HTTP_DATE = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_PATH_HTTP_DATE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_PATH_DEFAULT"] = ( + "MALFORMED_TIMESTAMP_PATH_DEFAULT", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_QUERY_DEFAULT = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_QUERY_DEFAULT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_PATH_EPOCH"] = ( + "MALFORMED_TIMESTAMP_PATH_EPOCH", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_QUERY_EPOCH = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_QUERY_EPOCH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_PATH_HTTP_DATE"] = ( + "MALFORMED_TIMESTAMP_PATH_HTTP_DATE", + (), + ("aws.auth#sigv4",), ) -MALFORMED_TIMESTAMP_QUERY_HTTP_DATE = APIOperation( - static_schema=_SCHEMA_MALFORMED_TIMESTAMP_QUERY_HTTP_DATE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_QUERY_DEFAULT"] = ( + "MALFORMED_TIMESTAMP_QUERY_DEFAULT", + (), + ("aws.auth#sigv4",), ) -MALFORMED_UNION = APIOperation( - static_schema=_SCHEMA_MALFORMED_UNION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_QUERY_EPOCH"] = ( + "MALFORMED_TIMESTAMP_QUERY_EPOCH", + (), + ("aws.auth#sigv4",), ) -MEDIA_TYPE_HEADER = APIOperation( - static_schema=_SCHEMA_MEDIA_TYPE_HEADER, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["MALFORMED_TIMESTAMP_QUERY_HTTP_DATE"] = ( + "MALFORMED_TIMESTAMP_QUERY_HTTP_DATE", + (), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_NO_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_NO_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MALFORMED_UNION"] = ("MALFORMED_UNION", (), ("aws.auth#sigv4",)) -NO_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["MEDIA_TYPE_HEADER"] = ("MEDIA_TYPE_HEADER", (), ("aws.auth#sigv4",)) -NULL_AND_EMPTY_HEADERS_CLIENT = APIOperation( - static_schema=_SCHEMA_NULL_AND_EMPTY_HEADERS_CLIENT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_NO_OUTPUT"] = ( + "NO_INPUT_AND_NO_OUTPUT", + (), + ("aws.auth#sigv4",), ) -NULL_AND_EMPTY_HEADERS_SERVER = APIOperation( - static_schema=_SCHEMA_NULL_AND_EMPTY_HEADERS_SERVER, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_OUTPUT"] = ( + "NO_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) -OMITS_NULL_SERIALIZES_EMPTY_STRING = APIOperation( - static_schema=_SCHEMA_OMITS_NULL_SERIALIZES_EMPTY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NULL_AND_EMPTY_HEADERS_CLIENT"] = ( + "NULL_AND_EMPTY_HEADERS_CLIENT", + (), + ("aws.auth#sigv4",), ) -OMITS_SERIALIZING_EMPTY_LISTS = APIOperation( - static_schema=_SCHEMA_OMITS_SERIALIZING_EMPTY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NULL_AND_EMPTY_HEADERS_SERVER"] = ( + "NULL_AND_EMPTY_HEADERS_SERVER", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_DEFAULTS = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_DEFAULTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OMITS_NULL_SERIALIZES_EMPTY_STRING"] = ( + "OMITS_NULL_SERIALIZES_EMPTY_STRING", + (), + ("aws.auth#sigv4",), ) -OPERATION_WITH_NESTED_STRUCTURE = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_NESTED_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OMITS_SERIALIZING_EMPTY_LISTS"] = ( + "OMITS_SERIALIZING_EMPTY_LISTS", + (), + ("aws.auth#sigv4",), ) -OUTPUT_STREAM = APIOperation( - static_schema=_SCHEMA_OUTPUT_STREAM, - model_registry=_registry, - error_ids=[ShapeID("aws.protocoltests.restjson#ServiceUnavailableError")], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_DEFAULTS"] = ( + "OPERATION_WITH_DEFAULTS", + (), + ("aws.auth#sigv4",), ) -OUTPUT_STREAM_WITH_INITIAL_RESPONSE = APIOperation( - static_schema=_SCHEMA_OUTPUT_STREAM_WITH_INITIAL_RESPONSE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OPERATION_WITH_NESTED_STRUCTURE"] = ( + "OPERATION_WITH_NESTED_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -POST_PLAYER_ACTION = APIOperation( - static_schema=_SCHEMA_POST_PLAYER_ACTION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OUTPUT_STREAM"] = ( + "OUTPUT_STREAM", + ("aws.protocoltests.restjson#ServiceUnavailableError",), + ("aws.auth#sigv4",), ) -POST_UNION_WITH_JSON_NAME = APIOperation( - static_schema=_SCHEMA_POST_UNION_WITH_JSON_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OUTPUT_STREAM_WITH_INITIAL_RESPONSE"] = ( + "OUTPUT_STREAM_WITH_INITIAL_RESPONSE", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["POST_PLAYER_ACTION"] = ("POST_PLAYER_ACTION", (), ("aws.auth#sigv4",)) -QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL = APIOperation( - static_schema=_SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["POST_UNION_WITH_JSON_NAME"] = ( + "POST_UNION_WITH_JSON_NAME", + (), + ("aws.auth#sigv4",), ) -QUERY_PARAMS_AS_STRING_LIST_MAP = APIOperation( - static_schema=_SCHEMA_QUERY_PARAMS_AS_STRING_LIST_MAP, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -QUERY_PRECEDENCE = APIOperation( - static_schema=_SCHEMA_QUERY_PRECEDENCE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL"] = ( + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + (), + ("aws.auth#sigv4",), ) -RESPONSE_CODE_HTTP_FALLBACK = APIOperation( - static_schema=_SCHEMA_RESPONSE_CODE_HTTP_FALLBACK, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_PARAMS_AS_STRING_LIST_MAP"] = ( + "QUERY_PARAMS_AS_STRING_LIST_MAP", + (), + ("aws.auth#sigv4",), ) -RESPONSE_CODE_REQUIRED = APIOperation( - static_schema=_SCHEMA_RESPONSE_CODE_REQUIRED, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_PRECEDENCE"] = ("QUERY_PRECEDENCE", (), ("aws.auth#sigv4",)) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["RESPONSE_CODE_HTTP_FALLBACK"] = ( + "RESPONSE_CODE_HTTP_FALLBACK", + (), + ("aws.auth#sigv4",), ) -SPARSE_JSON_LISTS = APIOperation( - static_schema=_SCHEMA_SPARSE_JSON_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["RESPONSE_CODE_REQUIRED"] = ( + "RESPONSE_CODE_REQUIRED", + (), + ("aws.auth#sigv4",), ) -SPARSE_JSON_MAPS = APIOperation( - static_schema=_SCHEMA_SPARSE_JSON_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("aws.auth#sigv4",), ) -STREAMING_TRAITS = APIOperation( - static_schema=_SCHEMA_STREAMING_TRAITS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["SPARSE_JSON_LISTS"] = ("SPARSE_JSON_LISTS", (), ("aws.auth#sigv4",)) -STREAMING_TRAITS_REQUIRE_LENGTH = APIOperation( - static_schema=_SCHEMA_STREAMING_TRAITS_REQUIRE_LENGTH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["SPARSE_JSON_MAPS"] = ("SPARSE_JSON_MAPS", (), ("aws.auth#sigv4",)) -STREAMING_TRAITS_WITH_MEDIA_TYPE = APIOperation( - static_schema=_SCHEMA_STREAMING_TRAITS_WITH_MEDIA_TYPE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["STREAMING_TRAITS"] = ("STREAMING_TRAITS", (), ("aws.auth#sigv4",)) -TEST_BODY_STRUCTURE = APIOperation( - static_schema=_SCHEMA_TEST_BODY_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["STREAMING_TRAITS_REQUIRE_LENGTH"] = ( + "STREAMING_TRAITS_REQUIRE_LENGTH", + (), + ("aws.auth#sigv4",), ) -TEST_GET_NO_INPUT_NO_PAYLOAD = APIOperation( - static_schema=_SCHEMA_TEST_GET_NO_INPUT_NO_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["STREAMING_TRAITS_WITH_MEDIA_TYPE"] = ( + "STREAMING_TRAITS_WITH_MEDIA_TYPE", + (), + ("aws.auth#sigv4",), ) -TEST_GET_NO_PAYLOAD = APIOperation( - static_schema=_SCHEMA_TEST_GET_NO_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_BODY_STRUCTURE"] = ( + "TEST_BODY_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -TEST_PAYLOAD_BLOB = APIOperation( - static_schema=_SCHEMA_TEST_PAYLOAD_BLOB, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_GET_NO_INPUT_NO_PAYLOAD"] = ( + "TEST_GET_NO_INPUT_NO_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -TEST_PAYLOAD_STRUCTURE = APIOperation( - static_schema=_SCHEMA_TEST_PAYLOAD_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_GET_NO_PAYLOAD"] = ( + "TEST_GET_NO_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -TEST_POST_NO_INPUT_NO_PAYLOAD = APIOperation( - static_schema=_SCHEMA_TEST_POST_NO_INPUT_NO_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_PAYLOAD_BLOB"] = ("TEST_PAYLOAD_BLOB", (), ("aws.auth#sigv4",)) + +_operation_data["TEST_PAYLOAD_STRUCTURE"] = ( + "TEST_PAYLOAD_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -TEST_POST_NO_PAYLOAD = APIOperation( - static_schema=_SCHEMA_TEST_POST_NO_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_POST_NO_INPUT_NO_PAYLOAD"] = ( + "TEST_POST_NO_INPUT_NO_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -TIMESTAMP_FORMAT_HEADERS = APIOperation( - static_schema=_SCHEMA_TIMESTAMP_FORMAT_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TEST_POST_NO_PAYLOAD"] = ( + "TEST_POST_NO_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -UNIT_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_UNIT_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TIMESTAMP_FORMAT_HEADERS"] = ( + "TIMESTAMP_FORMAT_HEADERS", + (), + ("aws.auth#sigv4",), ) -RECURSIVE_SHAPES = APIOperation( - static_schema=_SCHEMA_RECURSIVE_SHAPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["UNIT_INPUT_AND_OUTPUT"] = ( + "UNIT_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) + +_operation_data["RECURSIVE_SHAPES"] = ("RECURSIVE_SHAPES", (), ("aws.auth#sigv4",)) diff --git a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/client.py b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/client.py index 371f83fb7..227215e7f 100644 --- a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/client.py +++ b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/client.py @@ -17,8 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncRestXmlProtocolNamespaceConfig, Plugin -from .models import SIMPLE_SCALAR_PROPERTIES from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -164,6 +164,6 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) diff --git a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py index 9ba209ae7..6553f7cdf 100644 --- a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py +++ b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py @@ -6,10 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, -) - class ServiceError(ModeledError): """ @@ -38,14 +34,35 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ("SIMPLE_SCALAR_PROPERTIES",) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +def __dir__(): + return sorted({*globals(), *_operation_names}) + + +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("aws.auth#sigv4",), ) diff --git a/codegen-output/rest-xml/src/restxml/client.py b/codegen-output/rest-xml/src/restxml/client.py index df9f05d54..63a4101a2 100644 --- a/codegen-output/rest-xml/src/restxml/client.py +++ b/codegen-output/rest-xml/src/restxml/client.py @@ -17,74 +17,8 @@ from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import AsyncRestXmlProtocolConfig, Plugin -from .models import ( - ALL_QUERY_STRING_TYPES, - BODY_WITH_XML_NAME, - CONSTANT_AND_VARIABLE_QUERY_STRING, - CONSTANT_QUERY_STRING, - CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION, - FLATTENED_XML_MAP, - FLATTENED_XML_MAP_WITH_XML_NAME, - FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - HTTP_EMPTY_PREFIX_HEADERS, - HTTP_ENUM_PAYLOAD, - HTTP_PAYLOAD_TRAITS, - HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - HTTP_PAYLOAD_WITH_MEMBER_XML_NAME, - HTTP_PAYLOAD_WITH_STRUCTURE, - HTTP_PAYLOAD_WITH_UNION, - HTTP_PAYLOAD_WITH_XML_NAME, - HTTP_PAYLOAD_WITH_XML_NAMESPACE, - HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX, - HTTP_PREFIX_HEADERS, - HTTP_REQUEST_WITH_FLOAT_LABELS, - HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - HTTP_REQUEST_WITH_LABELS, - HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - HTTP_RESPONSE_CODE, - HTTP_STRING_PAYLOAD, - IGNORE_QUERY_PARAMS_IN_RESPONSE, - INPUT_AND_OUTPUT_WITH_HEADERS, - NESTED_XML_MAPS, - NESTED_XML_MAP_WITH_XML_NAME, - NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT, - NULL_AND_EMPTY_HEADERS_CLIENT, - NULL_AND_EMPTY_HEADERS_SERVER, - OMITS_NULL_SERIALIZES_EMPTY_STRING, - PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_PARAMS_AS_STRING_LIST_MAP, - QUERY_PRECEDENCE, - RECURSIVE_SHAPES, - SIMPLE_SCALAR_PROPERTIES, - TIMESTAMP_FORMAT_HEADERS, - XML_ATTRIBUTES, - XML_ATTRIBUTES_IN_MIDDLE, - XML_ATTRIBUTES_ON_PAYLOAD, - XML_BLOBS, - XML_EMPTY_BLOBS, - XML_EMPTY_LISTS, - XML_EMPTY_MAPS, - XML_EMPTY_STRINGS, - XML_ENUMS, - XML_INT_ENUMS, - XML_LISTS, - XML_MAPS, - XML_MAPS_XML_NAME, - XML_MAP_WITH_XML_NAMESPACE, - XML_NAMESPACES, - XML_TIMESTAMPS, - XML_UNIONS, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -355,7 +289,7 @@ async def all_query_string_types( An instance of `AllQueryStringTypesOutput`. """ pipeline, call = await self._prepare_call( - input, ALL_QUERY_STRING_TYPES, [], plugins + input, _models.ALL_QUERY_STRING_TYPES, [], plugins ) return await pipeline(call) @@ -379,7 +313,7 @@ async def body_with_xml_name( An instance of `BodyWithXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, BODY_WITH_XML_NAME, [], plugins + input, _models.BODY_WITH_XML_NAME, [], plugins ) return await pipeline(call) @@ -406,7 +340,7 @@ async def constant_and_variable_query_string( An instance of `ConstantAndVariableQueryStringOutput`. """ pipeline, call = await self._prepare_call( - input, CONSTANT_AND_VARIABLE_QUERY_STRING, [], plugins + input, _models.CONSTANT_AND_VARIABLE_QUERY_STRING, [], plugins ) return await pipeline(call) @@ -432,7 +366,7 @@ async def constant_query_string( An instance of `ConstantQueryStringOutput`. """ pipeline, call = await self._prepare_call( - input, CONSTANT_QUERY_STRING, [], plugins + input, _models.CONSTANT_QUERY_STRING, [], plugins ) return await pipeline(call) @@ -456,7 +390,7 @@ async def content_type_parameters( An instance of `ContentTypeParametersOutput`. """ pipeline, call = await self._prepare_call( - input, CONTENT_TYPE_PARAMETERS, [], plugins + input, _models.CONTENT_TYPE_PARAMETERS, [], plugins ) return await pipeline(call) @@ -478,7 +412,9 @@ async def datetime_offsets( Returns: An instance of `DatetimeOffsetsOutput`. """ - pipeline, call = await self._prepare_call(input, DATETIME_OFFSETS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.DATETIME_OFFSETS, [], plugins + ) return await pipeline(call) async def empty_input_and_empty_output( @@ -503,7 +439,7 @@ async def empty_input_and_empty_output( An instance of `EmptyInputAndEmptyOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_AND_EMPTY_OUTPUT, [], plugins ) return await pipeline(call) @@ -526,7 +462,7 @@ async def endpoint_operation( An instance of `EndpointOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_OPERATION, [], plugins + input, _models.ENDPOINT_OPERATION, [], plugins ) return await pipeline(call) @@ -551,7 +487,7 @@ async def endpoint_with_host_label_header_operation( An instance of `EndpointWithHostLabelHeaderOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION, [], plugins ) return await pipeline(call) @@ -576,7 +512,7 @@ async def endpoint_with_host_label_operation( An instance of `EndpointWithHostLabelOperationOutput`. """ pipeline, call = await self._prepare_call( - input, ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins + input, _models.ENDPOINT_WITH_HOST_LABEL_OPERATION, [], plugins ) return await pipeline(call) @@ -598,7 +534,9 @@ async def flattened_xml_map( Returns: An instance of `FlattenedXmlMapOutput`. """ - pipeline, call = await self._prepare_call(input, FLATTENED_XML_MAP, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.FLATTENED_XML_MAP, [], plugins + ) return await pipeline(call) async def flattened_xml_map_with_xml_name( @@ -622,7 +560,7 @@ async def flattened_xml_map_with_xml_name( An instance of `FlattenedXmlMapWithXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, FLATTENED_XML_MAP_WITH_XML_NAME, [], plugins + input, _models.FLATTENED_XML_MAP_WITH_XML_NAME, [], plugins ) return await pipeline(call) @@ -647,7 +585,7 @@ async def flattened_xml_map_with_xml_namespace( An instance of `FlattenedXmlMapWithXmlNamespaceOutput`. """ pipeline, call = await self._prepare_call( - input, FLATTENED_XML_MAP_WITH_XML_NAMESPACE, [], plugins + input, _models.FLATTENED_XML_MAP_WITH_XML_NAMESPACE, [], plugins ) return await pipeline(call) @@ -670,7 +608,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -697,7 +635,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -720,7 +658,7 @@ async def http_empty_prefix_headers( An instance of `HttpEmptyPrefixHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_EMPTY_PREFIX_HEADERS, [], plugins + input, _models.HTTP_EMPTY_PREFIX_HEADERS, [], plugins ) return await pipeline(call) @@ -742,7 +680,9 @@ async def http_enum_payload( Returns: An instance of `HttpEnumPayloadOutput`. """ - pipeline, call = await self._prepare_call(input, HTTP_ENUM_PAYLOAD, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.HTTP_ENUM_PAYLOAD, [], plugins + ) return await pipeline(call) async def http_payload_traits( @@ -766,7 +706,7 @@ async def http_payload_traits( An instance of `HttpPayloadTraitsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_TRAITS, [], plugins + input, _models.HTTP_PAYLOAD_TRAITS, [], plugins ) return await pipeline(call) @@ -792,7 +732,7 @@ async def http_payload_traits_with_media_type( An instance of `HttpPayloadTraitsWithMediaTypeOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, [], plugins + input, _models.HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, [], plugins ) return await pipeline(call) @@ -818,7 +758,7 @@ async def http_payload_with_member_xml_name( An instance of `HttpPayloadWithMemberXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_MEMBER_XML_NAME, [], plugins + input, _models.HTTP_PAYLOAD_WITH_MEMBER_XML_NAME, [], plugins ) return await pipeline(call) @@ -843,7 +783,7 @@ async def http_payload_with_structure( An instance of `HttpPayloadWithStructureOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_STRUCTURE, [], plugins + input, _models.HTTP_PAYLOAD_WITH_STRUCTURE, [], plugins ) return await pipeline(call) @@ -866,7 +806,7 @@ async def http_payload_with_union( An instance of `HttpPayloadWithUnionOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_UNION, [], plugins + input, _models.HTTP_PAYLOAD_WITH_UNION, [], plugins ) return await pipeline(call) @@ -890,7 +830,7 @@ async def http_payload_with_xml_name( An instance of `HttpPayloadWithXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_XML_NAME, [], plugins + input, _models.HTTP_PAYLOAD_WITH_XML_NAME, [], plugins ) return await pipeline(call) @@ -915,7 +855,7 @@ async def http_payload_with_xml_namespace( An instance of `HttpPayloadWithXmlNamespaceOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_XML_NAMESPACE, [], plugins + input, _models.HTTP_PAYLOAD_WITH_XML_NAMESPACE, [], plugins ) return await pipeline(call) @@ -940,7 +880,7 @@ async def http_payload_with_xml_namespace_and_prefix( An instance of `HttpPayloadWithXmlNamespaceAndPrefixOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX, [], plugins + input, _models.HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX, [], plugins ) return await pipeline(call) @@ -964,7 +904,7 @@ async def http_prefix_headers( An instance of `HttpPrefixHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_PREFIX_HEADERS, [], plugins + input, _models.HTTP_PREFIX_HEADERS, [], plugins ) return await pipeline(call) @@ -989,7 +929,7 @@ async def http_request_with_float_labels( An instance of `HttpRequestWithFloatLabelsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_FLOAT_LABELS, [], plugins + input, _models.HTTP_REQUEST_WITH_FLOAT_LABELS, [], plugins ) return await pipeline(call) @@ -1014,7 +954,7 @@ async def http_request_with_greedy_label_in_path( An instance of `HttpRequestWithGreedyLabelInPathOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, [], plugins + input, _models.HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, [], plugins ) return await pipeline(call) @@ -1038,7 +978,7 @@ async def http_request_with_labels( An instance of `HttpRequestWithLabelsOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_LABELS, [], plugins + input, _models.HTTP_REQUEST_WITH_LABELS, [], plugins ) return await pipeline(call) @@ -1064,7 +1004,7 @@ async def http_request_with_labels_and_timestamp_format( An instance of `HttpRequestWithLabelsAndTimestampFormatOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, [], plugins + input, _models.HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, [], plugins ) return await pipeline(call) @@ -1087,7 +1027,7 @@ async def http_response_code( An instance of `HttpResponseCodeOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_RESPONSE_CODE, [], plugins + input, _models.HTTP_RESPONSE_CODE, [], plugins ) return await pipeline(call) @@ -1110,7 +1050,7 @@ async def http_string_payload( An instance of `HttpStringPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, HTTP_STRING_PAYLOAD, [], plugins + input, _models.HTTP_STRING_PAYLOAD, [], plugins ) return await pipeline(call) @@ -1137,7 +1077,7 @@ async def ignore_query_params_in_response( An instance of `IgnoreQueryParamsInResponseOutput`. """ pipeline, call = await self._prepare_call( - input, IGNORE_QUERY_PARAMS_IN_RESPONSE, [], plugins + input, _models.IGNORE_QUERY_PARAMS_IN_RESPONSE, [], plugins ) return await pipeline(call) @@ -1161,7 +1101,7 @@ async def input_and_output_with_headers( An instance of `InputAndOutputWithHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, INPUT_AND_OUTPUT_WITH_HEADERS, [], plugins + input, _models.INPUT_AND_OUTPUT_WITH_HEADERS, [], plugins ) return await pipeline(call) @@ -1183,7 +1123,9 @@ async def nested_xml_maps( Returns: An instance of `NestedXmlMapsOutput`. """ - pipeline, call = await self._prepare_call(input, NESTED_XML_MAPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.NESTED_XML_MAPS, [], plugins + ) return await pipeline(call) async def nested_xml_map_with_xml_name( @@ -1205,7 +1147,7 @@ async def nested_xml_map_with_xml_name( An instance of `NestedXmlMapWithXmlNameOutput`. """ pipeline, call = await self._prepare_call( - input, NESTED_XML_MAP_WITH_XML_NAME, [], plugins + input, _models.NESTED_XML_MAP_WITH_XML_NAME, [], plugins ) return await pipeline(call) @@ -1231,7 +1173,7 @@ async def no_input_and_no_output( An instance of `NoInputAndNoOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_NO_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_NO_OUTPUT, [], plugins ) return await pipeline(call) @@ -1257,7 +1199,7 @@ async def no_input_and_output( An instance of `NoInputAndOutputOutput`. """ pipeline, call = await self._prepare_call( - input, NO_INPUT_AND_OUTPUT, [], plugins + input, _models.NO_INPUT_AND_OUTPUT, [], plugins ) return await pipeline(call) @@ -1281,7 +1223,7 @@ async def null_and_empty_headers_client( An instance of `NullAndEmptyHeadersClientOutput`. """ pipeline, call = await self._prepare_call( - input, NULL_AND_EMPTY_HEADERS_CLIENT, [], plugins + input, _models.NULL_AND_EMPTY_HEADERS_CLIENT, [], plugins ) return await pipeline(call) @@ -1305,7 +1247,7 @@ async def null_and_empty_headers_server( An instance of `NullAndEmptyHeadersServerOutput`. """ pipeline, call = await self._prepare_call( - input, NULL_AND_EMPTY_HEADERS_SERVER, [], plugins + input, _models.NULL_AND_EMPTY_HEADERS_SERVER, [], plugins ) return await pipeline(call) @@ -1330,7 +1272,7 @@ async def omits_null_serializes_empty_string( An instance of `OmitsNullSerializesEmptyStringOutput`. """ pipeline, call = await self._prepare_call( - input, OMITS_NULL_SERIALIZES_EMPTY_STRING, [], plugins + input, _models.OMITS_NULL_SERIALIZES_EMPTY_STRING, [], plugins ) return await pipeline(call) @@ -1353,7 +1295,7 @@ async def put_with_content_encoding( An instance of `PutWithContentEncodingOutput`. """ pipeline, call = await self._prepare_call( - input, PUT_WITH_CONTENT_ENCODING, [], plugins + input, _models.PUT_WITH_CONTENT_ENCODING, [], plugins ) return await pipeline(call) @@ -1378,7 +1320,7 @@ async def query_idempotency_token_auto_fill( An instance of `QueryIdempotencyTokenAutoFillOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins + input, _models.QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, [], plugins ) return await pipeline(call) @@ -1403,7 +1345,7 @@ async def query_params_as_string_list_map( An instance of `QueryParamsAsStringListMapOutput`. """ pipeline, call = await self._prepare_call( - input, QUERY_PARAMS_AS_STRING_LIST_MAP, [], plugins + input, _models.QUERY_PARAMS_AS_STRING_LIST_MAP, [], plugins ) return await pipeline(call) @@ -1425,7 +1367,9 @@ async def query_precedence( Returns: An instance of `QueryPrecedenceOutput`. """ - pipeline, call = await self._prepare_call(input, QUERY_PRECEDENCE, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.QUERY_PRECEDENCE, [], plugins + ) return await pipeline(call) async def recursive_shapes( @@ -1446,7 +1390,9 @@ async def recursive_shapes( Returns: An instance of `RecursiveShapesOutput`. """ - pipeline, call = await self._prepare_call(input, RECURSIVE_SHAPES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.RECURSIVE_SHAPES, [], plugins + ) return await pipeline(call) async def simple_scalar_properties( @@ -1468,7 +1414,7 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) @@ -1492,7 +1438,7 @@ async def timestamp_format_headers( An instance of `TimestampFormatHeadersOutput`. """ pipeline, call = await self._prepare_call( - input, TIMESTAMP_FORMAT_HEADERS, [], plugins + input, _models.TIMESTAMP_FORMAT_HEADERS, [], plugins ) return await pipeline(call) @@ -1514,7 +1460,9 @@ async def xml_attributes( Returns: An instance of `XmlAttributesOutput`. """ - pipeline, call = await self._prepare_call(input, XML_ATTRIBUTES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_ATTRIBUTES, [], plugins + ) return await pipeline(call) async def xml_attributes_in_middle( @@ -1540,7 +1488,7 @@ async def xml_attributes_in_middle( An instance of `XmlAttributesInMiddleOutput`. """ pipeline, call = await self._prepare_call( - input, XML_ATTRIBUTES_IN_MIDDLE, [], plugins + input, _models.XML_ATTRIBUTES_IN_MIDDLE, [], plugins ) return await pipeline(call) @@ -1564,7 +1512,7 @@ async def xml_attributes_on_payload( An instance of `XmlAttributesOnPayloadOutput`. """ pipeline, call = await self._prepare_call( - input, XML_ATTRIBUTES_ON_PAYLOAD, [], plugins + input, _models.XML_ATTRIBUTES_ON_PAYLOAD, [], plugins ) return await pipeline(call) @@ -1586,7 +1534,7 @@ async def xml_blobs( Returns: An instance of `XmlBlobsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_BLOBS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_BLOBS, [], plugins) return await pipeline(call) async def xml_empty_blobs( @@ -1607,7 +1555,9 @@ async def xml_empty_blobs( Returns: An instance of `XmlEmptyBlobsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_BLOBS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_BLOBS, [], plugins + ) return await pipeline(call) async def xml_empty_lists( @@ -1628,7 +1578,9 @@ async def xml_empty_lists( Returns: An instance of `XmlEmptyListsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_LISTS, [], plugins + ) return await pipeline(call) async def xml_empty_maps( @@ -1649,7 +1601,9 @@ async def xml_empty_maps( Returns: An instance of `XmlEmptyMapsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_MAPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_MAPS, [], plugins + ) return await pipeline(call) async def xml_empty_strings( @@ -1670,7 +1624,9 @@ async def xml_empty_strings( Returns: An instance of `XmlEmptyStringsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_EMPTY_STRINGS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_EMPTY_STRINGS, [], plugins + ) return await pipeline(call) async def xml_enums( @@ -1692,7 +1648,7 @@ async def xml_enums( Returns: An instance of `XmlEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_ENUMS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_ENUMS, [], plugins) return await pipeline(call) async def xml_int_enums( @@ -1714,7 +1670,9 @@ async def xml_int_enums( Returns: An instance of `XmlIntEnumsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_INT_ENUMS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_INT_ENUMS, [], plugins + ) return await pipeline(call) async def xml_lists( @@ -1740,7 +1698,7 @@ async def xml_lists( Returns: An instance of `XmlListsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_LISTS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_LISTS, [], plugins) return await pipeline(call) async def xml_maps( @@ -1761,7 +1719,7 @@ async def xml_maps( Returns: An instance of `XmlMapsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_MAPS, [], plugins) + pipeline, call = await self._prepare_call(input, _models.XML_MAPS, [], plugins) return await pipeline(call) async def xml_maps_xml_name( @@ -1782,7 +1740,9 @@ async def xml_maps_xml_name( Returns: An instance of `XmlMapsXmlNameOutput`. """ - pipeline, call = await self._prepare_call(input, XML_MAPS_XML_NAME, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_MAPS_XML_NAME, [], plugins + ) return await pipeline(call) async def xml_map_with_xml_namespace( @@ -1804,7 +1764,7 @@ async def xml_map_with_xml_namespace( An instance of `XmlMapWithXmlNamespaceOutput`. """ pipeline, call = await self._prepare_call( - input, XML_MAP_WITH_XML_NAMESPACE, [], plugins + input, _models.XML_MAP_WITH_XML_NAMESPACE, [], plugins ) return await pipeline(call) @@ -1826,7 +1786,9 @@ async def xml_namespaces( Returns: An instance of `XmlNamespacesOutput`. """ - pipeline, call = await self._prepare_call(input, XML_NAMESPACES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_NAMESPACES, [], plugins + ) return await pipeline(call) async def xml_timestamps( @@ -1848,7 +1810,9 @@ async def xml_timestamps( Returns: An instance of `XmlTimestampsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_TIMESTAMPS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_TIMESTAMPS, [], plugins + ) return await pipeline(call) async def xml_unions( @@ -1869,5 +1833,7 @@ async def xml_unions( Returns: An instance of `XmlUnionsOutput`. """ - pipeline, call = await self._prepare_call(input, XML_UNIONS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.XML_UNIONS, [], plugins + ) return await pipeline(call) diff --git a/codegen-output/rest-xml/src/restxml/models.py b/codegen-output/rest-xml/src/restxml/models.py index 4c37c3979..55c64b3ba 100644 --- a/codegen-output/rest-xml/src/restxml/models.py +++ b/codegen-output/rest-xml/src/restxml/models.py @@ -6,74 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - ALL_QUERY_STRING_TYPES as _SCHEMA_ALL_QUERY_STRING_TYPES, - BODY_WITH_XML_NAME as _SCHEMA_BODY_WITH_XML_NAME, - CONSTANT_AND_VARIABLE_QUERY_STRING as _SCHEMA_CONSTANT_AND_VARIABLE_QUERY_STRING, - CONSTANT_QUERY_STRING as _SCHEMA_CONSTANT_QUERY_STRING, - CONTENT_TYPE_PARAMETERS as _SCHEMA_CONTENT_TYPE_PARAMETERS, - DATETIME_OFFSETS as _SCHEMA_DATETIME_OFFSETS, - EMPTY_INPUT_AND_EMPTY_OUTPUT as _SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - ENDPOINT_OPERATION as _SCHEMA_ENDPOINT_OPERATION, - ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION, - ENDPOINT_WITH_HOST_LABEL_OPERATION as _SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - FLATTENED_XML_MAP as _SCHEMA_FLATTENED_XML_MAP, - FLATTENED_XML_MAP_WITH_XML_NAME as _SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAME, - FLATTENED_XML_MAP_WITH_XML_NAMESPACE as _SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - HTTP_EMPTY_PREFIX_HEADERS as _SCHEMA_HTTP_EMPTY_PREFIX_HEADERS, - HTTP_ENUM_PAYLOAD as _SCHEMA_HTTP_ENUM_PAYLOAD, - HTTP_PAYLOAD_TRAITS as _SCHEMA_HTTP_PAYLOAD_TRAITS, - HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE as _SCHEMA_HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - HTTP_PAYLOAD_WITH_MEMBER_XML_NAME as _SCHEMA_HTTP_PAYLOAD_WITH_MEMBER_XML_NAME, - HTTP_PAYLOAD_WITH_STRUCTURE as _SCHEMA_HTTP_PAYLOAD_WITH_STRUCTURE, - HTTP_PAYLOAD_WITH_UNION as _SCHEMA_HTTP_PAYLOAD_WITH_UNION, - HTTP_PAYLOAD_WITH_XML_NAME as _SCHEMA_HTTP_PAYLOAD_WITH_XML_NAME, - HTTP_PAYLOAD_WITH_XML_NAMESPACE as _SCHEMA_HTTP_PAYLOAD_WITH_XML_NAMESPACE, - HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX as _SCHEMA_HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX, - HTTP_PREFIX_HEADERS as _SCHEMA_HTTP_PREFIX_HEADERS, - HTTP_REQUEST_WITH_FLOAT_LABELS as _SCHEMA_HTTP_REQUEST_WITH_FLOAT_LABELS, - HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH as _SCHEMA_HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - HTTP_REQUEST_WITH_LABELS as _SCHEMA_HTTP_REQUEST_WITH_LABELS, - HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT as _SCHEMA_HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - HTTP_RESPONSE_CODE as _SCHEMA_HTTP_RESPONSE_CODE, - HTTP_STRING_PAYLOAD as _SCHEMA_HTTP_STRING_PAYLOAD, - IGNORE_QUERY_PARAMS_IN_RESPONSE as _SCHEMA_IGNORE_QUERY_PARAMS_IN_RESPONSE, - INPUT_AND_OUTPUT_WITH_HEADERS as _SCHEMA_INPUT_AND_OUTPUT_WITH_HEADERS, - NESTED_XML_MAPS as _SCHEMA_NESTED_XML_MAPS, - NESTED_XML_MAP_WITH_XML_NAME as _SCHEMA_NESTED_XML_MAP_WITH_XML_NAME, - NO_INPUT_AND_NO_OUTPUT as _SCHEMA_NO_INPUT_AND_NO_OUTPUT, - NO_INPUT_AND_OUTPUT as _SCHEMA_NO_INPUT_AND_OUTPUT, - NULL_AND_EMPTY_HEADERS_CLIENT as _SCHEMA_NULL_AND_EMPTY_HEADERS_CLIENT, - NULL_AND_EMPTY_HEADERS_SERVER as _SCHEMA_NULL_AND_EMPTY_HEADERS_SERVER, - OMITS_NULL_SERIALIZES_EMPTY_STRING as _SCHEMA_OMITS_NULL_SERIALIZES_EMPTY_STRING, - PUT_WITH_CONTENT_ENCODING as _SCHEMA_PUT_WITH_CONTENT_ENCODING, - QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL as _SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - QUERY_PARAMS_AS_STRING_LIST_MAP as _SCHEMA_QUERY_PARAMS_AS_STRING_LIST_MAP, - QUERY_PRECEDENCE as _SCHEMA_QUERY_PRECEDENCE, - RECURSIVE_SHAPES as _SCHEMA_RECURSIVE_SHAPES, - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, - TIMESTAMP_FORMAT_HEADERS as _SCHEMA_TIMESTAMP_FORMAT_HEADERS, - XML_ATTRIBUTES as _SCHEMA_XML_ATTRIBUTES, - XML_ATTRIBUTES_IN_MIDDLE as _SCHEMA_XML_ATTRIBUTES_IN_MIDDLE, - XML_ATTRIBUTES_ON_PAYLOAD as _SCHEMA_XML_ATTRIBUTES_ON_PAYLOAD, - XML_BLOBS as _SCHEMA_XML_BLOBS, - XML_EMPTY_BLOBS as _SCHEMA_XML_EMPTY_BLOBS, - XML_EMPTY_LISTS as _SCHEMA_XML_EMPTY_LISTS, - XML_EMPTY_MAPS as _SCHEMA_XML_EMPTY_MAPS, - XML_EMPTY_STRINGS as _SCHEMA_XML_EMPTY_STRINGS, - XML_ENUMS as _SCHEMA_XML_ENUMS, - XML_INT_ENUMS as _SCHEMA_XML_INT_ENUMS, - XML_LISTS as _SCHEMA_XML_LISTS, - XML_MAPS as _SCHEMA_XML_MAPS, - XML_MAPS_XML_NAME as _SCHEMA_XML_MAPS_XML_NAME, - XML_MAP_WITH_XML_NAMESPACE as _SCHEMA_XML_MAP_WITH_XML_NAMESPACE, - XML_NAMESPACES as _SCHEMA_XML_NAMESPACES, - XML_TIMESTAMPS as _SCHEMA_XML_TIMESTAMPS, - XML_UNIONS as _SCHEMA_XML_UNIONS, -) - class ServiceError(ModeledError): """ @@ -413,465 +345,392 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "ALL_QUERY_STRING_TYPES", + "BODY_WITH_XML_NAME", + "CONSTANT_AND_VARIABLE_QUERY_STRING", + "CONSTANT_QUERY_STRING", + "CONTENT_TYPE_PARAMETERS", + "DATETIME_OFFSETS", + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + "ENDPOINT_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION", + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + "FLATTENED_XML_MAP", + "FLATTENED_XML_MAP_WITH_XML_NAME", + "FLATTENED_XML_MAP_WITH_XML_NAMESPACE", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "HTTP_EMPTY_PREFIX_HEADERS", + "HTTP_ENUM_PAYLOAD", + "HTTP_PAYLOAD_TRAITS", + "HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE", + "HTTP_PAYLOAD_WITH_MEMBER_XML_NAME", + "HTTP_PAYLOAD_WITH_STRUCTURE", + "HTTP_PAYLOAD_WITH_UNION", + "HTTP_PAYLOAD_WITH_XML_NAME", + "HTTP_PAYLOAD_WITH_XML_NAMESPACE", + "HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX", + "HTTP_PREFIX_HEADERS", + "HTTP_REQUEST_WITH_FLOAT_LABELS", + "HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH", + "HTTP_REQUEST_WITH_LABELS", + "HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT", + "HTTP_RESPONSE_CODE", + "HTTP_STRING_PAYLOAD", + "IGNORE_QUERY_PARAMS_IN_RESPONSE", + "INPUT_AND_OUTPUT_WITH_HEADERS", + "NESTED_XML_MAPS", + "NESTED_XML_MAP_WITH_XML_NAME", + "NO_INPUT_AND_NO_OUTPUT", + "NO_INPUT_AND_OUTPUT", + "NULL_AND_EMPTY_HEADERS_CLIENT", + "NULL_AND_EMPTY_HEADERS_SERVER", + "OMITS_NULL_SERIALIZES_EMPTY_STRING", + "PUT_WITH_CONTENT_ENCODING", + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + "QUERY_PARAMS_AS_STRING_LIST_MAP", + "QUERY_PRECEDENCE", + "RECURSIVE_SHAPES", + "SIMPLE_SCALAR_PROPERTIES", + "TIMESTAMP_FORMAT_HEADERS", + "XML_ATTRIBUTES", + "XML_ATTRIBUTES_IN_MIDDLE", + "XML_ATTRIBUTES_ON_PAYLOAD", + "XML_BLOBS", + "XML_EMPTY_BLOBS", + "XML_EMPTY_LISTS", + "XML_EMPTY_MAPS", + "XML_EMPTY_STRINGS", + "XML_ENUMS", + "XML_INT_ENUMS", + "XML_LISTS", + "XML_MAPS", + "XML_MAPS_XML_NAME", + "XML_MAP_WITH_XML_NAMESPACE", + "XML_NAMESPACES", + "XML_TIMESTAMPS", + "XML_UNIONS", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -ALL_QUERY_STRING_TYPES = APIOperation( - static_schema=_SCHEMA_ALL_QUERY_STRING_TYPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -BODY_WITH_XML_NAME = APIOperation( - static_schema=_SCHEMA_BODY_WITH_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) -CONSTANT_AND_VARIABLE_QUERY_STRING = APIOperation( - static_schema=_SCHEMA_CONSTANT_AND_VARIABLE_QUERY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ALL_QUERY_STRING_TYPES"] = ( + "ALL_QUERY_STRING_TYPES", + (), + ("aws.auth#sigv4",), ) -CONSTANT_QUERY_STRING = APIOperation( - static_schema=_SCHEMA_CONSTANT_QUERY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["BODY_WITH_XML_NAME"] = ("BODY_WITH_XML_NAME", (), ("aws.auth#sigv4",)) -CONTENT_TYPE_PARAMETERS = APIOperation( - static_schema=_SCHEMA_CONTENT_TYPE_PARAMETERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONSTANT_AND_VARIABLE_QUERY_STRING"] = ( + "CONSTANT_AND_VARIABLE_QUERY_STRING", + (), + ("aws.auth#sigv4",), ) -DATETIME_OFFSETS = APIOperation( - static_schema=_SCHEMA_DATETIME_OFFSETS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONSTANT_QUERY_STRING"] = ( + "CONSTANT_QUERY_STRING", + (), + ("aws.auth#sigv4",), ) -EMPTY_INPUT_AND_EMPTY_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_AND_EMPTY_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["CONTENT_TYPE_PARAMETERS"] = ( + "CONTENT_TYPE_PARAMETERS", + (), + ("aws.auth#sigv4",), ) -ENDPOINT_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["DATETIME_OFFSETS"] = ("DATETIME_OFFSETS", (), ("aws.auth#sigv4",)) -ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["EMPTY_INPUT_AND_EMPTY_OUTPUT"] = ( + "EMPTY_INPUT_AND_EMPTY_OUTPUT", + (), + ("aws.auth#sigv4",), ) -ENDPOINT_WITH_HOST_LABEL_OPERATION = APIOperation( - static_schema=_SCHEMA_ENDPOINT_WITH_HOST_LABEL_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["ENDPOINT_OPERATION"] = ("ENDPOINT_OPERATION", (), ("aws.auth#sigv4",)) -FLATTENED_XML_MAP = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_HEADER_OPERATION", + (), + ("aws.auth#sigv4",), ) -FLATTENED_XML_MAP_WITH_XML_NAME = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["ENDPOINT_WITH_HOST_LABEL_OPERATION"] = ( + "ENDPOINT_WITH_HOST_LABEL_OPERATION", + (), + ("aws.auth#sigv4",), ) -FLATTENED_XML_MAP_WITH_XML_NAMESPACE = APIOperation( - static_schema=_SCHEMA_FLATTENED_XML_MAP_WITH_XML_NAMESPACE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FLATTENED_XML_MAP"] = ("FLATTENED_XML_MAP", (), ("aws.auth#sigv4",)) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["FLATTENED_XML_MAP_WITH_XML_NAME"] = ( + "FLATTENED_XML_MAP_WITH_XML_NAME", + (), + ("aws.auth#sigv4",), ) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("aws.protocoltests.restxml#InvalidGreeting"), - ShapeID("aws.protocoltests.restxml#ComplexError"), - ], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["FLATTENED_XML_MAP_WITH_XML_NAMESPACE"] = ( + "FLATTENED_XML_MAP_WITH_XML_NAMESPACE", + (), + ("aws.auth#sigv4",), ) -HTTP_EMPTY_PREFIX_HEADERS = APIOperation( - static_schema=_SCHEMA_HTTP_EMPTY_PREFIX_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["FRACTIONAL_SECONDS"] = ("FRACTIONAL_SECONDS", (), ("aws.auth#sigv4",)) -HTTP_ENUM_PAYLOAD = APIOperation( - static_schema=_SCHEMA_HTTP_ENUM_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "aws.protocoltests.restxml#InvalidGreeting", + "aws.protocoltests.restxml#ComplexError", + ), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_TRAITS = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_TRAITS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_EMPTY_PREFIX_HEADERS"] = ( + "HTTP_EMPTY_PREFIX_HEADERS", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["HTTP_ENUM_PAYLOAD"] = ("HTTP_ENUM_PAYLOAD", (), ("aws.auth#sigv4",)) -HTTP_PAYLOAD_WITH_MEMBER_XML_NAME = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_MEMBER_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_TRAITS"] = ( + "HTTP_PAYLOAD_TRAITS", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_STRUCTURE = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_STRUCTURE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE"] = ( + "HTTP_PAYLOAD_TRAITS_WITH_MEDIA_TYPE", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_UNION = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_UNION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_MEMBER_XML_NAME"] = ( + "HTTP_PAYLOAD_WITH_MEMBER_XML_NAME", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_XML_NAME = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_STRUCTURE"] = ( + "HTTP_PAYLOAD_WITH_STRUCTURE", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_XML_NAMESPACE = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_XML_NAMESPACE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_UNION"] = ( + "HTTP_PAYLOAD_WITH_UNION", + (), + ("aws.auth#sigv4",), ) -HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX = APIOperation( - static_schema=_SCHEMA_HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_XML_NAME"] = ( + "HTTP_PAYLOAD_WITH_XML_NAME", + (), + ("aws.auth#sigv4",), ) -HTTP_PREFIX_HEADERS = APIOperation( - static_schema=_SCHEMA_HTTP_PREFIX_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_XML_NAMESPACE"] = ( + "HTTP_PAYLOAD_WITH_XML_NAMESPACE", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_FLOAT_LABELS = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_FLOAT_LABELS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX"] = ( + "HTTP_PAYLOAD_WITH_XML_NAMESPACE_AND_PREFIX", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_PREFIX_HEADERS"] = ( + "HTTP_PREFIX_HEADERS", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_LABELS = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_LABELS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_FLOAT_LABELS"] = ( + "HTTP_REQUEST_WITH_FLOAT_LABELS", + (), + ("aws.auth#sigv4",), ) -HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT = APIOperation( - static_schema=_SCHEMA_HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH"] = ( + "HTTP_REQUEST_WITH_GREEDY_LABEL_IN_PATH", + (), + ("aws.auth#sigv4",), ) -HTTP_RESPONSE_CODE = APIOperation( - static_schema=_SCHEMA_HTTP_RESPONSE_CODE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_LABELS"] = ( + "HTTP_REQUEST_WITH_LABELS", + (), + ("aws.auth#sigv4",), ) -HTTP_STRING_PAYLOAD = APIOperation( - static_schema=_SCHEMA_HTTP_STRING_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT"] = ( + "HTTP_REQUEST_WITH_LABELS_AND_TIMESTAMP_FORMAT", + (), + ("aws.auth#sigv4",), ) -IGNORE_QUERY_PARAMS_IN_RESPONSE = APIOperation( - static_schema=_SCHEMA_IGNORE_QUERY_PARAMS_IN_RESPONSE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["HTTP_RESPONSE_CODE"] = ("HTTP_RESPONSE_CODE", (), ("aws.auth#sigv4",)) -INPUT_AND_OUTPUT_WITH_HEADERS = APIOperation( - static_schema=_SCHEMA_INPUT_AND_OUTPUT_WITH_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["HTTP_STRING_PAYLOAD"] = ( + "HTTP_STRING_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -NESTED_XML_MAPS = APIOperation( - static_schema=_SCHEMA_NESTED_XML_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["IGNORE_QUERY_PARAMS_IN_RESPONSE"] = ( + "IGNORE_QUERY_PARAMS_IN_RESPONSE", + (), + ("aws.auth#sigv4",), ) -NESTED_XML_MAP_WITH_XML_NAME = APIOperation( - static_schema=_SCHEMA_NESTED_XML_MAP_WITH_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["INPUT_AND_OUTPUT_WITH_HEADERS"] = ( + "INPUT_AND_OUTPUT_WITH_HEADERS", + (), + ("aws.auth#sigv4",), ) -NO_INPUT_AND_NO_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_NO_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["NESTED_XML_MAPS"] = ("NESTED_XML_MAPS", (), ("aws.auth#sigv4",)) -NO_INPUT_AND_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_AND_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NESTED_XML_MAP_WITH_XML_NAME"] = ( + "NESTED_XML_MAP_WITH_XML_NAME", + (), + ("aws.auth#sigv4",), ) -NULL_AND_EMPTY_HEADERS_CLIENT = APIOperation( - static_schema=_SCHEMA_NULL_AND_EMPTY_HEADERS_CLIENT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_NO_OUTPUT"] = ( + "NO_INPUT_AND_NO_OUTPUT", + (), + ("aws.auth#sigv4",), ) -NULL_AND_EMPTY_HEADERS_SERVER = APIOperation( - static_schema=_SCHEMA_NULL_AND_EMPTY_HEADERS_SERVER, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NO_INPUT_AND_OUTPUT"] = ( + "NO_INPUT_AND_OUTPUT", + (), + ("aws.auth#sigv4",), ) -OMITS_NULL_SERIALIZES_EMPTY_STRING = APIOperation( - static_schema=_SCHEMA_OMITS_NULL_SERIALIZES_EMPTY_STRING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NULL_AND_EMPTY_HEADERS_CLIENT"] = ( + "NULL_AND_EMPTY_HEADERS_CLIENT", + (), + ("aws.auth#sigv4",), ) -PUT_WITH_CONTENT_ENCODING = APIOperation( - static_schema=_SCHEMA_PUT_WITH_CONTENT_ENCODING, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["NULL_AND_EMPTY_HEADERS_SERVER"] = ( + "NULL_AND_EMPTY_HEADERS_SERVER", + (), + ("aws.auth#sigv4",), ) -QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL = APIOperation( - static_schema=_SCHEMA_QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["OMITS_NULL_SERIALIZES_EMPTY_STRING"] = ( + "OMITS_NULL_SERIALIZES_EMPTY_STRING", + (), + ("aws.auth#sigv4",), ) -QUERY_PARAMS_AS_STRING_LIST_MAP = APIOperation( - static_schema=_SCHEMA_QUERY_PARAMS_AS_STRING_LIST_MAP, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["PUT_WITH_CONTENT_ENCODING"] = ( + "PUT_WITH_CONTENT_ENCODING", + (), + ("aws.auth#sigv4",), ) -QUERY_PRECEDENCE = APIOperation( - static_schema=_SCHEMA_QUERY_PRECEDENCE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL"] = ( + "QUERY_IDEMPOTENCY_TOKEN_AUTO_FILL", + (), + ("aws.auth#sigv4",), ) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["QUERY_PARAMS_AS_STRING_LIST_MAP"] = ( + "QUERY_PARAMS_AS_STRING_LIST_MAP", + (), + ("aws.auth#sigv4",), ) -TIMESTAMP_FORMAT_HEADERS = APIOperation( - static_schema=_SCHEMA_TIMESTAMP_FORMAT_HEADERS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["QUERY_PRECEDENCE"] = ("QUERY_PRECEDENCE", (), ("aws.auth#sigv4",)) -XML_ATTRIBUTES = APIOperation( - static_schema=_SCHEMA_XML_ATTRIBUTES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("aws.auth#sigv4",), ) -XML_ATTRIBUTES_IN_MIDDLE = APIOperation( - static_schema=_SCHEMA_XML_ATTRIBUTES_IN_MIDDLE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["TIMESTAMP_FORMAT_HEADERS"] = ( + "TIMESTAMP_FORMAT_HEADERS", + (), + ("aws.auth#sigv4",), ) -XML_ATTRIBUTES_ON_PAYLOAD = APIOperation( - static_schema=_SCHEMA_XML_ATTRIBUTES_ON_PAYLOAD, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_ATTRIBUTES"] = ("XML_ATTRIBUTES", (), ("aws.auth#sigv4",)) -XML_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["XML_ATTRIBUTES_IN_MIDDLE"] = ( + "XML_ATTRIBUTES_IN_MIDDLE", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_BLOBS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_BLOBS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["XML_ATTRIBUTES_ON_PAYLOAD"] = ( + "XML_ATTRIBUTES_ON_PAYLOAD", + (), + ("aws.auth#sigv4",), ) -XML_EMPTY_LISTS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_BLOBS"] = ("XML_BLOBS", (), ("aws.auth#sigv4",)) -XML_EMPTY_MAPS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_BLOBS"] = ("XML_EMPTY_BLOBS", (), ("aws.auth#sigv4",)) -XML_EMPTY_STRINGS = APIOperation( - static_schema=_SCHEMA_XML_EMPTY_STRINGS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_LISTS"] = ("XML_EMPTY_LISTS", (), ("aws.auth#sigv4",)) -XML_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_MAPS"] = ("XML_EMPTY_MAPS", (), ("aws.auth#sigv4",)) -XML_INT_ENUMS = APIOperation( - static_schema=_SCHEMA_XML_INT_ENUMS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_EMPTY_STRINGS"] = ("XML_EMPTY_STRINGS", (), ("aws.auth#sigv4",)) -XML_LISTS = APIOperation( - static_schema=_SCHEMA_XML_LISTS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_ENUMS"] = ("XML_ENUMS", (), ("aws.auth#sigv4",)) -XML_MAPS = APIOperation( - static_schema=_SCHEMA_XML_MAPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_INT_ENUMS"] = ("XML_INT_ENUMS", (), ("aws.auth#sigv4",)) -XML_MAPS_XML_NAME = APIOperation( - static_schema=_SCHEMA_XML_MAPS_XML_NAME, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_LISTS"] = ("XML_LISTS", (), ("aws.auth#sigv4",)) -XML_MAP_WITH_XML_NAMESPACE = APIOperation( - static_schema=_SCHEMA_XML_MAP_WITH_XML_NAMESPACE, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_MAPS"] = ("XML_MAPS", (), ("aws.auth#sigv4",)) -XML_NAMESPACES = APIOperation( - static_schema=_SCHEMA_XML_NAMESPACES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_MAPS_XML_NAME"] = ("XML_MAPS_XML_NAME", (), ("aws.auth#sigv4",)) -XML_TIMESTAMPS = APIOperation( - static_schema=_SCHEMA_XML_TIMESTAMPS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +_operation_data["XML_MAP_WITH_XML_NAMESPACE"] = ( + "XML_MAP_WITH_XML_NAMESPACE", + (), + ("aws.auth#sigv4",), ) -XML_UNIONS = APIOperation( - static_schema=_SCHEMA_XML_UNIONS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_NAMESPACES"] = ("XML_NAMESPACES", (), ("aws.auth#sigv4",)) -RECURSIVE_SHAPES = APIOperation( - static_schema=_SCHEMA_RECURSIVE_SHAPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], -) +_operation_data["XML_TIMESTAMPS"] = ("XML_TIMESTAMPS", (), ("aws.auth#sigv4",)) + +_operation_data["XML_UNIONS"] = ("XML_UNIONS", (), ("aws.auth#sigv4",)) + +_operation_data["RECURSIVE_SHAPES"] = ("RECURSIVE_SHAPES", (), ("aws.auth#sigv4",)) diff --git a/codegen-output/rpcv2-cbor/src/rpcv2cbor/client.py b/codegen-output/rpcv2-cbor/src/rpcv2cbor/client.py index 0afc2b410..2e417d273 100644 --- a/codegen-output/rpcv2-cbor/src/rpcv2cbor/client.py +++ b/codegen-output/rpcv2-cbor/src/rpcv2cbor/client.py @@ -13,23 +13,8 @@ from smithy_core.serializers import SerializeableShape from smithy_http.plugins import user_agent_plugin +from . import models as _models from .config import Config, Plugin -from .models import ( - EMPTY_INPUT_OUTPUT, - FLOAT16, - FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS, - NO_INPUT_OUTPUT, - OPERATION_WITH_DEFAULTS, - OPTIONAL_INPUT_OUTPUT, - RECURSIVE_SHAPES, - RPC_V2_CBOR_DENSE_MAPS, - RPC_V2_CBOR_LISTS, - RPC_V2_CBOR_SPARSE_MAPS, - RPC_V2_CBOR_UNIONS, - SIMPLE_SCALAR_PROPERTIES, - SPARSE_NULLS_OPERATION, -) from .user_agent import aws_user_agent_plugin from typing import TYPE_CHECKING @@ -180,7 +165,7 @@ async def empty_input_output( An instance of `EmptyInputOutputOutput`. """ pipeline, call = await self._prepare_call( - input, EMPTY_INPUT_OUTPUT, [], plugins + input, _models.EMPTY_INPUT_OUTPUT, [], plugins ) return await pipeline(call) @@ -202,7 +187,7 @@ async def float16( Returns: An instance of `Float16Output`. """ - pipeline, call = await self._prepare_call(input, FLOAT16, [], plugins) + pipeline, call = await self._prepare_call(input, _models.FLOAT16, [], plugins) return await pipeline(call) async def fractional_seconds( @@ -224,7 +209,7 @@ async def fractional_seconds( An instance of `FractionalSecondsOutput`. """ pipeline, call = await self._prepare_call( - input, FRACTIONAL_SECONDS, [], plugins + input, _models.FRACTIONAL_SECONDS, [], plugins ) return await pipeline(call) @@ -254,7 +239,7 @@ async def greeting_with_errors( An instance of `GreetingWithErrorsOutput`. """ pipeline, call = await self._prepare_call( - input, GREETING_WITH_ERRORS, [], plugins + input, _models.GREETING_WITH_ERRORS, [], plugins ) return await pipeline(call) @@ -276,7 +261,9 @@ async def no_input_output( Returns: An instance of `NoInputOutputOutput`. """ - pipeline, call = await self._prepare_call(input, NO_INPUT_OUTPUT, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.NO_INPUT_OUTPUT, [], plugins + ) return await pipeline(call) async def operation_with_defaults( @@ -298,7 +285,7 @@ async def operation_with_defaults( An instance of `OperationWithDefaultsOutput`. """ pipeline, call = await self._prepare_call( - input, OPERATION_WITH_DEFAULTS, [], plugins + input, _models.OPERATION_WITH_DEFAULTS, [], plugins ) return await pipeline(call) @@ -321,7 +308,7 @@ async def optional_input_output( An instance of `OptionalInputOutputOutput`. """ pipeline, call = await self._prepare_call( - input, OPTIONAL_INPUT_OUTPUT, [], plugins + input, _models.OPTIONAL_INPUT_OUTPUT, [], plugins ) return await pipeline(call) @@ -343,7 +330,9 @@ async def recursive_shapes( Returns: An instance of `RecursiveShapesOutput`. """ - pipeline, call = await self._prepare_call(input, RECURSIVE_SHAPES, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.RECURSIVE_SHAPES, [], plugins + ) return await pipeline(call) async def rpc_v2_cbor_dense_maps( @@ -365,7 +354,7 @@ async def rpc_v2_cbor_dense_maps( An instance of `RpcV2CborDenseMapsOutput`. """ pipeline, call = await self._prepare_call( - input, RPC_V2_CBOR_DENSE_MAPS, [], plugins + input, _models.RPC_V2_CBOR_DENSE_MAPS, [], plugins ) return await pipeline(call) @@ -393,7 +382,9 @@ async def rpc_v2_cbor_lists( Returns: An instance of `RpcV2CborListsOutput`. """ - pipeline, call = await self._prepare_call(input, RPC_V2_CBOR_LISTS, [], plugins) + pipeline, call = await self._prepare_call( + input, _models.RPC_V2_CBOR_LISTS, [], plugins + ) return await pipeline(call) async def rpc_v2_cbor_sparse_maps( @@ -415,7 +406,7 @@ async def rpc_v2_cbor_sparse_maps( An instance of `RpcV2CborSparseMapsOutput`. """ pipeline, call = await self._prepare_call( - input, RPC_V2_CBOR_SPARSE_MAPS, [], plugins + input, _models.RPC_V2_CBOR_SPARSE_MAPS, [], plugins ) return await pipeline(call) @@ -438,7 +429,7 @@ async def rpc_v2_cbor_unions( An instance of `RpcV2CborUnionsOutput`. """ pipeline, call = await self._prepare_call( - input, RPC_V2_CBOR_UNIONS, [], plugins + input, _models.RPC_V2_CBOR_UNIONS, [], plugins ) return await pipeline(call) @@ -461,7 +452,7 @@ async def simple_scalar_properties( An instance of `SimpleScalarPropertiesOutput`. """ pipeline, call = await self._prepare_call( - input, SIMPLE_SCALAR_PROPERTIES, [], plugins + input, _models.SIMPLE_SCALAR_PROPERTIES, [], plugins ) return await pipeline(call) @@ -484,6 +475,6 @@ async def sparse_nulls_operation( An instance of `SparseNullsOperationOutput`. """ pipeline, call = await self._prepare_call( - input, SPARSE_NULLS_OPERATION, [], plugins + input, _models.SPARSE_NULLS_OPERATION, [], plugins ) return await pipeline(call) diff --git a/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py b/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py index 0288e3664..6e6f6e326 100644 --- a/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py +++ b/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py @@ -6,23 +6,6 @@ from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from ._private.schemas import ( - EMPTY_INPUT_OUTPUT as _SCHEMA_EMPTY_INPUT_OUTPUT, - FLOAT16 as _SCHEMA_FLOAT16, - FRACTIONAL_SECONDS as _SCHEMA_FRACTIONAL_SECONDS, - GREETING_WITH_ERRORS as _SCHEMA_GREETING_WITH_ERRORS, - NO_INPUT_OUTPUT as _SCHEMA_NO_INPUT_OUTPUT, - OPERATION_WITH_DEFAULTS as _SCHEMA_OPERATION_WITH_DEFAULTS, - OPTIONAL_INPUT_OUTPUT as _SCHEMA_OPTIONAL_INPUT_OUTPUT, - RECURSIVE_SHAPES as _SCHEMA_RECURSIVE_SHAPES, - RPC_V2_CBOR_DENSE_MAPS as _SCHEMA_RPC_V2_CBOR_DENSE_MAPS, - RPC_V2_CBOR_LISTS as _SCHEMA_RPC_V2_CBOR_LISTS, - RPC_V2_CBOR_SPARSE_MAPS as _SCHEMA_RPC_V2_CBOR_SPARSE_MAPS, - RPC_V2_CBOR_UNIONS as _SCHEMA_RPC_V2_CBOR_UNIONS, - SIMPLE_SCALAR_PROPERTIES as _SCHEMA_SIMPLE_SCALAR_PROPERTIES, - SPARSE_NULLS_OPERATION as _SCHEMA_SPARSE_NULLS_OPERATION, -) - class ServiceError(ModeledError): """ @@ -140,108 +123,119 @@ class ServiceError(ModeledError): service_error="ServiceError", ) +_operation_data = {} +_operation_names = ( + "EMPTY_INPUT_OUTPUT", + "FLOAT16", + "FRACTIONAL_SECONDS", + "GREETING_WITH_ERRORS", + "NO_INPUT_OUTPUT", + "OPERATION_WITH_DEFAULTS", + "OPTIONAL_INPUT_OUTPUT", + "RECURSIVE_SHAPES", + "RPC_V2_CBOR_DENSE_MAPS", + "RPC_V2_CBOR_LISTS", + "RPC_V2_CBOR_SPARSE_MAPS", + "RPC_V2_CBOR_UNIONS", + "SIMPLE_SCALAR_PROPERTIES", + "SPARSE_NULLS_OPERATION", +) +for _operation_name in _operation_names: + globals().pop(_operation_name, None) + +__all__ = [name for name in globals() if not name.startswith("_")] +__all__.extend(_operation_names) + def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], + ) + globals()[name] = operation + return operation return _registry.build(name) -EMPTY_INPUT_OUTPUT = APIOperation( - static_schema=_SCHEMA_EMPTY_INPUT_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], -) +def __dir__(): + return sorted({*globals(), *_operation_names}) -FLOAT16 = APIOperation( - static_schema=_SCHEMA_FLOAT16, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], -) -FRACTIONAL_SECONDS = APIOperation( - static_schema=_SCHEMA_FRACTIONAL_SECONDS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["EMPTY_INPUT_OUTPUT"] = ( + "EMPTY_INPUT_OUTPUT", + (), + ("smithy.api#noAuth",), ) -GREETING_WITH_ERRORS = APIOperation( - static_schema=_SCHEMA_GREETING_WITH_ERRORS, - model_registry=_registry, - error_ids=[ - ShapeID("smithy.protocoltests.rpcv2Cbor#InvalidGreeting"), - ShapeID("smithy.protocoltests.rpcv2Cbor#ComplexError"), - ], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], -) +_operation_data["FLOAT16"] = ("FLOAT16", (), ("smithy.api#noAuth",)) -NO_INPUT_OUTPUT = APIOperation( - static_schema=_SCHEMA_NO_INPUT_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["FRACTIONAL_SECONDS"] = ( + "FRACTIONAL_SECONDS", + (), + ("smithy.api#noAuth",), ) -OPERATION_WITH_DEFAULTS = APIOperation( - static_schema=_SCHEMA_OPERATION_WITH_DEFAULTS, - model_registry=_registry, - error_ids=[ShapeID("smithy.framework#ValidationException")], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["GREETING_WITH_ERRORS"] = ( + "GREETING_WITH_ERRORS", + ( + "smithy.protocoltests.rpcv2Cbor#InvalidGreeting", + "smithy.protocoltests.rpcv2Cbor#ComplexError", + ), + ("smithy.api#noAuth",), ) -OPTIONAL_INPUT_OUTPUT = APIOperation( - static_schema=_SCHEMA_OPTIONAL_INPUT_OUTPUT, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["NO_INPUT_OUTPUT"] = ("NO_INPUT_OUTPUT", (), ("smithy.api#noAuth",)) + +_operation_data["OPERATION_WITH_DEFAULTS"] = ( + "OPERATION_WITH_DEFAULTS", + ("smithy.framework#ValidationException",), + ("smithy.api#noAuth",), ) -RPC_V2_CBOR_DENSE_MAPS = APIOperation( - static_schema=_SCHEMA_RPC_V2_CBOR_DENSE_MAPS, - model_registry=_registry, - error_ids=[ShapeID("smithy.framework#ValidationException")], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["OPTIONAL_INPUT_OUTPUT"] = ( + "OPTIONAL_INPUT_OUTPUT", + (), + ("smithy.api#noAuth",), ) -RPC_V2_CBOR_LISTS = APIOperation( - static_schema=_SCHEMA_RPC_V2_CBOR_LISTS, - model_registry=_registry, - error_ids=[ShapeID("smithy.framework#ValidationException")], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["RPC_V2_CBOR_DENSE_MAPS"] = ( + "RPC_V2_CBOR_DENSE_MAPS", + ("smithy.framework#ValidationException",), + ("smithy.api#noAuth",), ) -RPC_V2_CBOR_SPARSE_MAPS = APIOperation( - static_schema=_SCHEMA_RPC_V2_CBOR_SPARSE_MAPS, - model_registry=_registry, - error_ids=[ShapeID("smithy.framework#ValidationException")], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["RPC_V2_CBOR_LISTS"] = ( + "RPC_V2_CBOR_LISTS", + ("smithy.framework#ValidationException",), + ("smithy.api#noAuth",), ) -RPC_V2_CBOR_UNIONS = APIOperation( - static_schema=_SCHEMA_RPC_V2_CBOR_UNIONS, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["RPC_V2_CBOR_SPARSE_MAPS"] = ( + "RPC_V2_CBOR_SPARSE_MAPS", + ("smithy.framework#ValidationException",), + ("smithy.api#noAuth",), ) -SIMPLE_SCALAR_PROPERTIES = APIOperation( - static_schema=_SCHEMA_SIMPLE_SCALAR_PROPERTIES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["RPC_V2_CBOR_UNIONS"] = ( + "RPC_V2_CBOR_UNIONS", + (), + ("smithy.api#noAuth",), ) -SPARSE_NULLS_OPERATION = APIOperation( - static_schema=_SCHEMA_SPARSE_NULLS_OPERATION, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["SIMPLE_SCALAR_PROPERTIES"] = ( + "SIMPLE_SCALAR_PROPERTIES", + (), + ("smithy.api#noAuth",), ) -RECURSIVE_SHAPES = APIOperation( - static_schema=_SCHEMA_RECURSIVE_SHAPES, - model_registry=_registry, - error_ids=[], - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +_operation_data["SPARSE_NULLS_OPERATION"] = ( + "SPARSE_NULLS_OPERATION", + (), + ("smithy.api#noAuth",), ) + +_operation_data["RECURSIVE_SHAPES"] = ("RECURSIVE_SHAPES", (), ("smithy.api#noAuth",)) diff --git a/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java b/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java index f92fbefde..c265aacf6 100644 --- a/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java +++ b/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java @@ -49,6 +49,8 @@ public void testCodegen(@TempDir Path tempDir) throws IOException { assertFalse(client.contains("max_attempts=")); assertTrue(client.contains("(AsyncClient):")); assertTrue(client.contains("await self._prepare_call(")); + assertTrue(client.contains("from . import models as _models")); + assertTrue(client.contains("_models.GET_CITY,")); var config = Files.readString(tempDir.resolve("src/weather/config.py")); assertTrue(config.contains("self.transport = transport or AIOHTTPClient()")); @@ -62,6 +64,13 @@ public void testCodegen(@TempDir Path tempDir) throws IOException { assertTrue(models.contains("response_metadata: ResponseMetadata")); assertTrue(models.contains("response_metadata_:")); + var runtimeModels = Files.readString(tempDir.resolve("src/weather/models.py")); + assertTrue(runtimeModels.contains("_operation_names = (")); + assertTrue(runtimeModels.contains("_operation_data[\"GET_CITY\"]")); + assertTrue(runtimeModels.contains("__all__.extend(_operation_names)")); + assertTrue(runtimeModels.contains("globals()[name] = operation")); + assertFalse(runtimeModels.contains("GET_CITY = APIOperation(")); + // Event streams are passed through the stream API, not model constructors. var typecheck = Files.readString(tempDir.resolve("tests/_typecheck.py")); assertFalse(typecheck.contains("stream=_")); diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java index 45f2c1dcd..59039eaa5 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java @@ -52,6 +52,7 @@ public void run() { private void generateService(PythonWriter writer) { var serviceSymbol = symbolProvider.toSymbol(service); writer.addLocallyDefinedSymbol(serviceSymbol); + writer.addImport(context.settings().moduleName(), "models", "_models"); var configSymbol = CodegenUtils.getConfigSymbol(context.settings()); var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings()); writer.addLogger(); @@ -258,7 +259,7 @@ private void generateOperation(PythonWriter writer, OperationShape operation) { // Input/output types are used ONLY in annotations here. Import them under // TYPE_CHECKING and reference by bare name (with future-annotations deferring // the annotations) so importing the client does not eagerly build every model - // class. The operation constant below is a real runtime import. + // class. Operations are resolved through the models module when invoked. writer.getImportContainer().enableFutureAnnotations(); writer.getImportContainer() .addTypeCheckingImport( @@ -275,7 +276,7 @@ private void generateOperation(PythonWriter writer, OperationShape operation) { writer.putContext("output", outputSymbol.getName()); writer.putContext("plugin", pluginSymbol); writer.putContext("operationName", operationMethodSymbol.getName()); - writer.putContext("operation", symbolProvider.toSymbol(operation)); + writer.putContext("operation", "_models." + operationSymbol.getName()); writer.write(""" async def ${operationName:L}( self, @@ -285,7 +286,7 @@ private void generateOperation(PythonWriter writer, OperationShape operation) { ${C|} pipeline, call = await self._prepare_call( input, - ${operation:T}, + ${operation:L}, [ ${C|} ], @@ -357,7 +358,7 @@ private void generateEventStreamOperation(PythonWriter writer, OperationShape op writer.addDependency(SmithyPythonDependency.SMITHY_CORE); writer.addDependency(SmithyPythonDependency.SMITHY_AWS_CORE.withOptionalDependencies("eventstream")); var operationSymbol = symbolProvider.toSymbol(operation); - writer.putContext("operation", operationSymbol); + writer.putContext("operation", "_models." + operationSymbol.getName()); var operationMethodSymbol = operationSymbol.expectProperty(OPERATION_METHOD); writer.putContext("operationName", operationMethodSymbol.getName()); var pluginSymbol = CodegenUtils.getPluginSymbol(context.settings()); @@ -403,7 +404,7 @@ private void generateEventStreamOperation(PythonWriter writer, OperationShape op ${C|} pipeline, call = await self._prepare_call( input, - ${operation:T}, + ${operation:L}, [ ${C|} ], @@ -430,7 +431,7 @@ private void generateEventStreamOperation(PythonWriter writer, OperationShape op ${C|} pipeline, call = await self._prepare_call( input, - ${operation:T}, + ${operation:L}, [ ${C|} ], @@ -456,7 +457,7 @@ private void generateEventStreamOperation(PythonWriter writer, OperationShape op ${C|} pipeline, call = await self._prepare_call( input, - ${operation:T}, + ${operation:L}, [ ${C|} ], diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java index 7a4925e56..ed121e86e 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java @@ -4,6 +4,7 @@ */ package software.amazon.smithy.python.codegen.generators; +import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import software.amazon.smithy.model.shapes.ShapeType; import software.amazon.smithy.python.codegen.GenerationContext; import software.amazon.smithy.python.codegen.PythonSettings; +import software.amazon.smithy.python.codegen.SmithyPythonDependency; import software.amazon.smithy.python.codegen.SymbolProperties; import software.amazon.smithy.python.codegen.writer.PythonWriter; import software.amazon.smithy.utils.SmithyInternalApi; @@ -45,7 +47,10 @@ public void run() { context.writerDelegator().useFileWriter(filename, namespace, writer -> { // addImport hoists these into the file's import block so they land at the // top even though ServiceError/operations also write into this file. + writer.addDependency(SmithyPythonDependency.SMITHY_CORE); writer.addImport("smithy_core._dynamic_models", "ModelRegistry"); + writer.addImport("smithy_core.schemas", "APIOperation"); + writer.addImport("smithy_core.shapes", "ShapeID"); writer.addImport("._private", "schemas", "_schemas"); var symbolProvider = context.symbolProvider(); @@ -62,8 +67,13 @@ public void run() { // every real shape-id name, so the registry reproduces the symbol provider's // variant-name collision disambiguation at build time. var shapeNames = new TreeSet(); + var operationNames = new ArrayList(); for (var shape : shapes) { + if (shape.isOperationShape()) { + operationNames.add(symbolProvider.toSymbol(shape).getName()); + continue; + } if (!isModelShape(shape) || Prelude.isPreludeShape(shape)) { continue; } @@ -110,11 +120,39 @@ public void run() { writer.write("service_error=\"ServiceError\","); }); - // No runtime __all__: names are provided lazily by __getattr__ (a static - // __all__ would trip F822). The typed __all__Lives in models.pyi. + writer.write("_operation_data = {}"); + writer.openBlock("_operation_names = (", ")", () -> { + for (var name : operationNames) { + writer.write("$S,", name); + } + }); + writer.write(""" + for _operation_name in _operation_names: + globals().pop(_operation_name, None) + + __all__ = [name for name in globals() if not name.startswith("_")] + __all__.extend(_operation_names) + """); + writer.write(""" def __getattr__(name: str): + if (data := _operation_data.get(name)) is not None: + schema_name, error_ids, auth_scheme_ids = data + operation = APIOperation( + static_schema=getattr(_schemas, schema_name), + model_registry=_registry, + error_ids=[ShapeID(shape_id) for shape_id in error_ids], + effective_auth_schemes=[ + ShapeID(shape_id) for shape_id in auth_scheme_ids + ], + ) + globals()[name] = operation + return operation return _registry.build(name) + + + def __dir__(): + return sorted({*globals(), *_operation_names}) """); }); } diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/OperationGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/OperationGenerator.java index 1480903b4..35c450588 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/OperationGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/OperationGenerator.java @@ -4,22 +4,17 @@ */ package software.amazon.smithy.python.codegen.generators; -import java.util.logging.Logger; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.knowledge.ServiceIndex; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.python.codegen.GenerationContext; -import software.amazon.smithy.python.codegen.RuntimeTypes; -import software.amazon.smithy.python.codegen.SmithyPythonDependency; import software.amazon.smithy.python.codegen.SymbolProperties; import software.amazon.smithy.python.codegen.writer.PythonWriter; import software.amazon.smithy.utils.SmithyInternalApi; @SmithyInternalApi public final class OperationGenerator implements Runnable { - private static final Logger LOGGER = Logger.getLogger(OperationGenerator.class.getName()); - private final GenerationContext context; private final PythonWriter writer; private final OperationShape shape; @@ -39,30 +34,26 @@ public void run() { var opSymbol = symbolProvider.toSymbol(shape); writer.addLocallyDefinedSymbol(opSymbol); - writer.addDependency(SmithyPythonDependency.SMITHY_CORE); - writer.write(""" - $1L = $2T( - static_schema = $3T, - model_registry = _registry, - error_ids = [ - $4C - ], - effective_auth_schemes = [ - $5C - ], + _operation_data[$1S] = ( + $2S, + ( + $3C + ), + ( + $4C + ), ) """, opSymbol.getName(), - RuntimeTypes.API_OPERATION, - opSymbol.expectProperty(SymbolProperties.SCHEMA), + opSymbol.expectProperty(SymbolProperties.SCHEMA).getSymbol().getName(), writer.consumer(this::writeErrorIds), writer.consumer(this::writeAuthSchemes)); } private void writeErrorIds(PythonWriter writer) { for (var error : shape.getErrors()) { - writer.write("$1T($2S),", RuntimeTypes.SHAPE_ID, error); + writer.write("$S,", error); } } @@ -73,8 +64,7 @@ private void writeAuthSchemes(PythonWriter writer) { ServiceIndex.AuthSchemeMode.NO_AUTH_AWARE); for (var authSchemeId : authSchemes.keySet()) { - writer.write("$1T($2S),", RuntimeTypes.SHAPE_ID, authSchemeId); + writer.write("$S,", authSchemeId); } - } } From 0fb73d9fe8f1e58883d5f167b73e58bcf2d7ddf5 Mon Sep 17 00:00:00 2001 From: Sean O'Brien <60306702+stobrien89@users.noreply.github.com> Date: Sat, 31 Oct 2026 17:04:05 -0400 Subject: [PATCH 2/2] fix(codegen): preserve lazy operation identity --- codegen-output/aws-json-1-0/src/awsjson10/models.py | 3 +-- codegen-output/aws-json-1-1/src/awsjson11/models.py | 3 +-- codegen-output/aws-query/src/awsquery/models.py | 3 +-- codegen-output/ec2-query/src/ec2query/models.py | 3 +-- .../my-handwritten-model/src/my_handwritten_model/models.py | 3 +-- codegen-output/rest-json-1/src/restjson/models.py | 3 +-- .../rest-xml-with-namespace/src/restxmlwithnamespace/models.py | 3 +-- codegen-output/rest-xml/src/restxml/models.py | 3 +-- codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py | 3 +-- .../amazon/smithy/python/codegen/test/PythonCodegenTest.java | 2 +- .../smithy/python/codegen/generators/ModelModuleGenerator.java | 3 +-- 11 files changed, 11 insertions(+), 21 deletions(-) diff --git a/codegen-output/aws-json-1-0/src/awsjson10/models.py b/codegen-output/aws-json-1-0/src/awsjson10/models.py index 3c2214f9a..8ba148438 100644 --- a/codegen-output/aws-json-1-0/src/awsjson10/models.py +++ b/codegen-output/aws-json-1-0/src/awsjson10/models.py @@ -172,8 +172,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/aws-json-1-1/src/awsjson11/models.py b/codegen-output/aws-json-1-1/src/awsjson11/models.py index 6b4917dde..4eab5e869 100644 --- a/codegen-output/aws-json-1-1/src/awsjson11/models.py +++ b/codegen-output/aws-json-1-1/src/awsjson11/models.py @@ -175,8 +175,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/aws-query/src/awsquery/models.py b/codegen-output/aws-query/src/awsquery/models.py index b7721eacc..6b111a4dd 100644 --- a/codegen-output/aws-query/src/awsquery/models.py +++ b/codegen-output/aws-query/src/awsquery/models.py @@ -240,8 +240,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/ec2-query/src/ec2query/models.py b/codegen-output/ec2-query/src/ec2query/models.py index 6af7f9201..175de9a2c 100644 --- a/codegen-output/ec2-query/src/ec2query/models.py +++ b/codegen-output/ec2-query/src/ec2query/models.py @@ -196,8 +196,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py b/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py index 67347e773..570b6ea61 100644 --- a/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py +++ b/codegen-output/my-handwritten-model/src/my_handwritten_model/models.py @@ -96,8 +96,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/rest-json-1/src/restjson/models.py b/codegen-output/rest-json-1/src/restjson/models.py index c9bbc28cd..7f39f3e1d 100644 --- a/codegen-output/rest-json-1/src/restjson/models.py +++ b/codegen-output/rest-json-1/src/restjson/models.py @@ -732,8 +732,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py index 6553f7cdf..699d6527e 100644 --- a/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py +++ b/codegen-output/rest-xml-with-namespace/src/restxmlwithnamespace/models.py @@ -52,8 +52,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/rest-xml/src/restxml/models.py b/codegen-output/rest-xml/src/restxml/models.py index 55c64b3ba..f13d580e0 100644 --- a/codegen-output/rest-xml/src/restxml/models.py +++ b/codegen-output/rest-xml/src/restxml/models.py @@ -429,8 +429,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py b/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py index 6e6f6e326..3eadff6be 100644 --- a/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py +++ b/codegen-output/rpcv2-cbor/src/rpcv2cbor/models.py @@ -156,8 +156,7 @@ def __getattr__(name: str): error_ids=[ShapeID(shape_id) for shape_id in error_ids], effective_auth_schemes=[ShapeID(shape_id) for shape_id in auth_scheme_ids], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name) diff --git a/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java b/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java index c265aacf6..5bcd568f7 100644 --- a/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java +++ b/codegen/core/src/it/java/software/amazon/smithy/python/codegen/test/PythonCodegenTest.java @@ -68,7 +68,7 @@ public void testCodegen(@TempDir Path tempDir) throws IOException { assertTrue(runtimeModels.contains("_operation_names = (")); assertTrue(runtimeModels.contains("_operation_data[\"GET_CITY\"]")); assertTrue(runtimeModels.contains("__all__.extend(_operation_names)")); - assertTrue(runtimeModels.contains("globals()[name] = operation")); + assertTrue(runtimeModels.contains("return globals().setdefault(name, operation)")); assertFalse(runtimeModels.contains("GET_CITY = APIOperation(")); // Event streams are passed through the stream API, not model constructors. diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java index ed121e86e..033c2fa81 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ModelModuleGenerator.java @@ -146,8 +146,7 @@ def __getattr__(name: str): ShapeID(shape_id) for shape_id in auth_scheme_ids ], ) - globals()[name] = operation - return operation + return globals().setdefault(name, operation) return _registry.build(name)