From 44057d000f80f3b0c64dd6911aa377879cc9b0a1 Mon Sep 17 00:00:00 2001 From: SamRemis Date: Fri, 21 Nov 2025 16:49:20 -0500 Subject: [PATCH 1/2] Release: Amazon Transcribe Streaming Client --- .../CHANGELOG.md | 8 + .../aws-sdk-sagemaker-runtime-http2/LICENSE | 175 ++ .../aws-sdk-sagemaker-runtime-http2/NOTICE | 1 + .../aws-sdk-sagemaker-runtime-http2/README.md | 13 + .../docs/Makefile | 15 + .../docs/README.md | 10 + .../docs/client/index.rst | 11 + ...oke_endpoint_with_bidirectional_stream.rst | 25 + .../docs/conf.py | 30 + .../docs/index.rst | 12 + .../docs/make.bat | 35 + .../docs/models/InputValidationError.rst | 9 + .../docs/models/InternalServerError.rst | 9 + .../docs/models/InternalStreamFailure.rst | 9 + .../docs/models/ModelError.rst | 9 + .../docs/models/ModelStreamError.rst | 9 + .../docs/models/RequestPayloadPart.rst | 8 + .../docs/models/RequestStreamEvent.rst | 9 + .../models/RequestStreamEventPayloadPart.rst | 9 + .../docs/models/RequestStreamEventUnknown.rst | 9 + .../docs/models/ResponsePayloadPart.rst | 8 + .../docs/models/ResponseStreamEvent.rst | 9 + ...sponseStreamEventInternalStreamFailure.rst | 9 + .../ResponseStreamEventModelStreamError.rst | 9 + .../models/ResponseStreamEventPayloadPart.rst | 9 + .../models/ResponseStreamEventUnknown.rst | 9 + .../docs/models/ServiceUnavailableError.rst | 9 + .../docs/models/index.rst | 11 + .../pyproject.toml | 73 + .../__init__.py | 3 + .../_private/__init__.py | 1 + .../_private/schemas.py | 2442 ++++++++++++++++ .../aws_sdk_sagemaker_runtime_http2/auth.py | 24 + .../aws_sdk_sagemaker_runtime_http2/client.py | 144 + .../aws_sdk_sagemaker_runtime_http2/config.py | 166 ++ .../aws_sdk_sagemaker_runtime_http2/models.py | 776 ++++++ .../user_agent.py | 17 + .../tests/__init__.py | 1 + .../tests/test_protocol.py | 58 + .../aws-models/sagemaker-runtime-http2.json | 2461 +++++++++++++++++ 40 files changed, 6654 insertions(+) create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/CHANGELOG.md create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/LICENSE create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/NOTICE create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/README.md create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/Makefile create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/README.md create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/client/index.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/client/invoke_endpoint_with_bidirectional_stream.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/index.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/make.bat create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/InputValidationError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalServerError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalStreamFailure.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelStreamError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestPayloadPart.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEvent.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventPayloadPart.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventUnknown.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponsePayloadPart.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEvent.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventInternalStreamFailure.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventModelStreamError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventPayloadPart.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventUnknown.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/ServiceUnavailableError.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/docs/models/index.rst create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/pyproject.toml create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/__init__.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/__init__.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/user_agent.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/tests/__init__.py create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py create mode 100644 codegen/aws-models/sagemaker-runtime-http2.json diff --git a/clients/aws-sdk-sagemaker-runtime-http2/CHANGELOG.md b/clients/aws-sdk-sagemaker-runtime-http2/CHANGELOG.md new file mode 100644 index 0000000..b0ce462 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## Unreleased + +## v0.1.0 + +### Features +* Initial client release with support for current Amazon SageMaker Runtime HTTP2 operations. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/LICENSE b/clients/aws-sdk-sagemaker-runtime-http2/LICENSE new file mode 100644 index 0000000..67db858 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/NOTICE b/clients/aws-sdk-sagemaker-runtime-http2/NOTICE new file mode 100644 index 0000000..616fc58 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/NOTICE @@ -0,0 +1 @@ +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/README.md b/clients/aws-sdk-sagemaker-runtime-http2/README.md new file mode 100644 index 0000000..2c4de60 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/README.md @@ -0,0 +1,13 @@ +## Amazon SageMaker Runtime HTTP2 Client + +The aws_sdk_sagemaker_runtime_http2 client is still under active developement. +Changes may result in breaking changes prior to the release of version +1.0.0. + +### Documentation + +Documentation is available in the `/docs` directory of this package. +Pages can be built into portable HTML files for the time being. You can +follow the instructions in the docs [README.md](https://github.com/awslabs/aws-sdk-python/blob/main/clients/aws-sdk-sagemaker-runtime-http2/docs/README.md). + +For high-level documentation, you can view the [`dev-guide`](https://github.com/awslabs/aws-sdk-python/tree/main/dev-guide) at the top level of this repo. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/Makefile b/clients/aws-sdk-sagemaker-runtime-http2/docs/Makefile new file mode 100644 index 0000000..59458fa --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/Makefile @@ -0,0 +1,15 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +SPHINXBUILD = sphinx-build +BUILDDIR = build +SERVICESDIR = source/reference/services +SPHINXOPTS = -j auto +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/README.md b/clients/aws-sdk-sagemaker-runtime-http2/docs/README.md new file mode 100644 index 0000000..141b2c7 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/README.md @@ -0,0 +1,10 @@ +## Generating Documentation + +Sphinx is used for documentation. You can generate HTML locally with the +following: + +``` +$ uv pip install --group docs . +$ cd docs +$ make html +``` diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/client/index.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/client/index.rst new file mode 100644 index 0000000..371f32a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/client/index.rst @@ -0,0 +1,11 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +Client +======= +.. toctree:: + :maxdepth: 1 + :titlesonly: + :glob: + + * diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/client/invoke_endpoint_with_bidirectional_stream.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/client/invoke_endpoint_with_bidirectional_stream.rst new file mode 100644 index 0000000..6f8143a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/client/invoke_endpoint_with_bidirectional_stream.rst @@ -0,0 +1,25 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +invoke_endpoint_with_bidirectional_stream +========================================= + +.. automethod:: aws_sdk_sagemaker_runtime_http2.client.SageMakerRuntimeHTTP2Client.invoke_endpoint_with_bidirectional_stream + +.. toctree:: + :hidden: + :maxdepth: 2 + +================= +Input: +================= + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.InvokeEndpointWithBidirectionalStreamInput + :members: + +================= +Output: +================= + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.InvokeEndpointWithBidirectionalStreamOutput + :members: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py b/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py new file mode 100644 index 0000000..8ce0f7a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py @@ -0,0 +1,30 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +import os +import sys +sys.path.insert(0, os.path.abspath('..')) + +project = 'Amazon SageMaker Runtime HTTP2' +author = 'Amazon Web Services' +release = '0.1.0' + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.viewcode', +] + +templates_path = ['_templates'] +exclude_patterns = [] + +autodoc_default_options = { + 'exclude-members': 'deserialize,deserialize_kwargs,serialize,serialize_members' +} + +html_theme = 'pydata_sphinx_theme' +html_theme_options = { + "logo": { + "text": "Amazon SageMaker Runtime HTTP2", + } +} + +autodoc_typehints = 'description' diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/index.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/index.rst new file mode 100644 index 0000000..bebb6b1 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/index.rst @@ -0,0 +1,12 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +Amazon SageMaker Runtime HTTP2 +============================== + +.. toctree:: + :maxdepth: 2 + :titlesonly: + :glob: + + */index diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/make.bat b/clients/aws-sdk-sagemaker-runtime-http2/docs/make.bat new file mode 100644 index 0000000..3245132 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/make.bat @@ -0,0 +1,35 @@ +REM Code generated by smithy-python-codegen DO NOT EDIT. + +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set SERVICESDIR=source/reference/services +set SPHINXOPTS=-j auto +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . + +if "%1" == "" goto help + +if "%1" == "clean" ( + rmdir /S /Q %BUILDDIR% + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo "Build finished. The HTML pages are in %BUILDDIR%/html." + goto end +) + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InputValidationError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InputValidationError.rst new file mode 100644 index 0000000..62049d4 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InputValidationError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +InputValidationError +==================== + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.InputValidationError + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalServerError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalServerError.rst new file mode 100644 index 0000000..2056072 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalServerError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +InternalServerError +=================== + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.InternalServerError + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalStreamFailure.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalStreamFailure.rst new file mode 100644 index 0000000..a08da4b --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/InternalStreamFailure.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +InternalStreamFailure +===================== + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.InternalStreamFailure + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelError.rst new file mode 100644 index 0000000..af0a19b --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +ModelError +========== + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.ModelError + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelStreamError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelStreamError.rst new file mode 100644 index 0000000..402ca42 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ModelStreamError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +ModelStreamError +================ + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.ModelStreamError + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestPayloadPart.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestPayloadPart.rst new file mode 100644 index 0000000..eeeca1b --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestPayloadPart.rst @@ -0,0 +1,8 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +RequestPayloadPart +================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.RequestPayloadPart + :members: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEvent.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEvent.rst new file mode 100644 index 0000000..f1050c7 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEvent.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _RequestStreamEvent: + +RequestStreamEvent +================== + +.. autodata:: aws_sdk_sagemaker_runtime_http2.models.RequestStreamEvent diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventPayloadPart.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventPayloadPart.rst new file mode 100644 index 0000000..fc4834e --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventPayloadPart.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _RequestStreamEventPayloadPart: + +RequestStreamEventPayloadPart +============================= + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.RequestStreamEventPayloadPart diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventUnknown.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventUnknown.rst new file mode 100644 index 0000000..769b832 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/RequestStreamEventUnknown.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _RequestStreamEventUnknown: + +RequestStreamEventUnknown +========================= + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.RequestStreamEventUnknown diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponsePayloadPart.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponsePayloadPart.rst new file mode 100644 index 0000000..cc0e7a7 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponsePayloadPart.rst @@ -0,0 +1,8 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +ResponsePayloadPart +=================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.ResponsePayloadPart + :members: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEvent.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEvent.rst new file mode 100644 index 0000000..9089eef --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEvent.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _ResponseStreamEvent: + +ResponseStreamEvent +=================== + +.. autodata:: aws_sdk_sagemaker_runtime_http2.models.ResponseStreamEvent diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventInternalStreamFailure.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventInternalStreamFailure.rst new file mode 100644 index 0000000..c6047ed --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventInternalStreamFailure.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _ResponseStreamEventInternalStreamFailure: + +ResponseStreamEventInternalStreamFailure +======================================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.ResponseStreamEventInternalStreamFailure diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventModelStreamError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventModelStreamError.rst new file mode 100644 index 0000000..df57dcb --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventModelStreamError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _ResponseStreamEventModelStreamError: + +ResponseStreamEventModelStreamError +=================================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.ResponseStreamEventModelStreamError diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventPayloadPart.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventPayloadPart.rst new file mode 100644 index 0000000..fab46c7 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventPayloadPart.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _ResponseStreamEventPayloadPart: + +ResponseStreamEventPayloadPart +============================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.ResponseStreamEventPayloadPart diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventUnknown.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventUnknown.rst new file mode 100644 index 0000000..5a8f95a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ResponseStreamEventUnknown.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +.. _ResponseStreamEventUnknown: + +ResponseStreamEventUnknown +========================== + +.. autoclass:: aws_sdk_sagemaker_runtime_http2.models.ResponseStreamEventUnknown diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ServiceUnavailableError.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ServiceUnavailableError.rst new file mode 100644 index 0000000..b245543 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/ServiceUnavailableError.rst @@ -0,0 +1,9 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +ServiceUnavailableError +======================= + +.. autoexception:: aws_sdk_sagemaker_runtime_http2.models.ServiceUnavailableError + :members: + :show-inheritance: diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/models/index.rst b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/index.rst new file mode 100644 index 0000000..c403929 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/models/index.rst @@ -0,0 +1,11 @@ +.. + Code generated by smithy-python-codegen DO NOT EDIT. + +Models +======= +.. toctree:: + :maxdepth: 1 + :titlesonly: + :glob: + + * diff --git a/clients/aws-sdk-sagemaker-runtime-http2/pyproject.toml b/clients/aws-sdk-sagemaker-runtime-http2/pyproject.toml new file mode 100644 index 0000000..8b9a41a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/pyproject.toml @@ -0,0 +1,73 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + + +[project] +name = "aws_sdk_sagemaker_runtime_http2" +version = "0.1.0" +description = "aws_sdk_sagemaker_runtime_http2 client" +readme = "README.md" +requires-python = ">=3.12" +keywords = ["smithy", "aws_sdk_sagemaker_runtime_http2"] +license = {text = "Apache-2.0"} +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Natural Language :: English", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14" +] + +dependencies = [ + "smithy_aws_core[eventstream, json]~=0.2.0", + "smithy_core~=0.2.0", + "smithy_http[awscrt]~=0.3.0" +] + +[dependency-groups] +test = [ + "pytest>=7.2.0,<8.0.0", + "pytest-asyncio>=0.20.3,<0.21.0" +] + +docs = [ + "pydata-sphinx-theme>=0.16.1", + "sphinx>=8.2.3" +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.bdist] +exclude = [ + "tests", + "docs", +] + +[tool.pyright] +typeCheckingMode = "strict" +reportPrivateUsage = false +reportUnusedFunction = false +reportUnusedVariable = false +reportUnnecessaryComparison = false +reportUnusedClass = false +enableExperimentalFeatures = true + +[tool.ruff] +target-version = "py312" + +[tool.ruff.lint] +ignore = ["F841"] + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.pytest.ini_options] +python_classes = ["!Test"] +asyncio_mode = "auto" diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/__init__.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/__init__.py new file mode 100644 index 0000000..e1ee049 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/__init__.py @@ -0,0 +1,3 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +__version__: str = "0.1.0" diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/__init__.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/__init__.py new file mode 100644 index 0000000..247be3e --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/__init__.py @@ -0,0 +1 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py new file mode 100644 index 0000000..ea4eebc --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py @@ -0,0 +1,2442 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from types import MappingProxyType + +from smithy_core.prelude import INTEGER, STRING +from smithy_core.schemas import Schema +from smithy_core.shapes import ShapeID, ShapeType +from smithy_core.traits import Trait + + +INPUT_VALIDATION_ERROR = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=400), + + ], + members={ + "Message": { + "target": STRING, + }, + + "ErrorCode": { + "target": STRING, + }, + + } +) + +INTERNAL_SERVER_ERROR = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="server"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=500), + + ], + members={ + "Message": { + "target": STRING, + }, + + "ErrorCode": { + "target": STRING, + }, + + } +) + +INTERNAL_STREAM_FAILURE = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="server"), + + ], + members={ + "Message": { + "target": STRING, + }, + + } +) + +SENSITIVE_BLOB = Schema( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#SensitiveBlob"), + shape_type=ShapeType.BLOB, + traits=[ + Trait.new(id=ShapeID("smithy.api#sensitive")), + + ], + +) + +REQUEST_PAYLOAD_PART = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestPayloadPart"), + + members={ + "Bytes": { + "target": SENSITIVE_BLOB, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventPayload")), + + ], + }, + + "DataType": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$"), + + ], + }, + + "CompletionState": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$"), + + ], + }, + + "P": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + + ], + }, + + } +) + +REQUEST_STREAM_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestStreamEvent"), + shape_type=ShapeType.UNION, + traits=[ + Trait.new(id=ShapeID("smithy.api#streaming")), + + ], + members={ + "PayloadPart": { + "target": REQUEST_PAYLOAD_PART, + }, + + } +) + +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#input")), + + ], + members={ + "EndpointName": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpLabel")), + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ + "max": 63, + })), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), + + ], + }, + + "Body": { + "target": REQUEST_STREAM_EVENT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpPayload")), + + ], + }, + + "TargetVariant": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Target-Variant"), + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ + "max": 63, + })), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), + + ], + }, + + "ModelInvocationPath": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Model-Invocation-Path"), + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ + "max": 100, + })), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[A-Za-z0-9\\-._]+(?:/[A-Za-z0-9\\-._]+)*$"), + + ], + }, + + "ModelQueryString": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Model-Query-String"), + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ + "max": 2048, + })), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+(?:&[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+)*$"), + + ], + }, + + } +) + +MODEL_STREAM_ERROR = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + + ], + members={ + "Message": { + "target": STRING, + }, + + "ErrorCode": { + "target": STRING, + }, + + } +) + +RESPONSE_PAYLOAD_PART = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponsePayloadPart"), + + members={ + "Bytes": { + "target": SENSITIVE_BLOB, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventPayload")), + + ], + }, + + "DataType": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$"), + + ], + }, + + "CompletionState": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + Trait.new(id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$"), + + ], + }, + + "P": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#eventHeader")), + + ], + }, + + } +) + +RESPONSE_STREAM_EVENT = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponseStreamEvent"), + shape_type=ShapeType.UNION, + traits=[ + Trait.new(id=ShapeID("smithy.api#streaming")), + + ], + members={ + "PayloadPart": { + "target": RESPONSE_PAYLOAD_PART, + }, + + "ModelStreamError": { + "target": MODEL_STREAM_ERROR, + }, + + "InternalStreamFailure": { + "target": INTERNAL_STREAM_FAILURE, + }, + + } +) + +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#output")), + + ], + members={ + "Body": { + "target": RESPONSE_STREAM_EVENT, + "traits": [ + Trait.new(id=ShapeID("smithy.api#required")), + Trait.new(id=ShapeID("smithy.api#httpPayload")), + + ], + }, + + "InvokedProductionVariant": { + "target": STRING, + "traits": [ + Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Invoked-Production-Variant"), + Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ + "max": 1024, + })), + Trait.new(id=ShapeID("smithy.api#pattern"), value="\\p{ASCII}*"), + + ], + }, + + } +) + +MODEL_ERROR = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="client"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=424), + + ], + members={ + "Message": { + "target": STRING, + }, + + "OriginalStatusCode": { + "target": INTEGER, + }, + + "OriginalMessage": { + "target": STRING, + }, + + "LogStreamArn": { + "target": STRING, + }, + + "ErrorCode": { + "target": STRING, + }, + + } +) + +SERVICE_UNAVAILABLE_ERROR = Schema.collection( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"), + + traits=[ + Trait.new(id=ShapeID("smithy.api#error"), value="server"), + Trait.new(id=ShapeID("smithy.api#httpError"), value=503), + + ], + members={ + "Message": { + "target": STRING, + }, + + "ErrorCode": { + "target": STRING, + }, + + } +) + +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = Schema( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream"), + shape_type=ShapeType.OPERATION, + traits=[ + Trait.new(id=ShapeID("smithy.api#http"), value=MappingProxyType({ + "method": "POST", + "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream", + })), + + ], + +) + +AMAZON_SAGE_MAKER_RUNTIME_HTTP2 = Schema( + id=ShapeID("com.amazonaws.sagemakerruntimehttp2#AmazonSageMakerRuntimeHttp2"), + shape_type=ShapeType.SERVICE, + traits=[ + Trait.new(id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({ + "name": "sagemaker", + })), + Trait.new(id=ShapeID("smithy.api#title"), value="Amazon SageMaker Runtime HTTP2"), + Trait.new(id=ShapeID("smithy.rules#endpointTests"), value=MappingProxyType({ + "testCases": ( + MappingProxyType({ + "documentation": "For custom endpoint with region not set and fips disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://example.com", + }), + }), + "params": MappingProxyType({ + "Endpoint": "https://example.com", + "UseFIPS": False, + }), + }), + MappingProxyType({ + "documentation": "For custom endpoint with fips enabled", + "expect": MappingProxyType({ + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + }), + "params": MappingProxyType({ + "Endpoint": "https://example.com", + "UseFIPS": True, + }), + }), + MappingProxyType({ + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": MappingProxyType({ + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + }), + "params": MappingProxyType({ + "Endpoint": "https://example.com", + "UseFIPS": False, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-east-1.api.aws:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-east-1", + "UseFIPS": True, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-east-1.amazonaws.com:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-east-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-east-1.api.aws:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-east-1", + "UseFIPS": False, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-east-1.amazonaws.com:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-east-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443", + }), + }), + "params": MappingProxyType({ + "Region": "cn-northwest-1", + "UseFIPS": True, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.cn-northwest-1.amazonaws.com.cn:8443", + }), + }), + "params": MappingProxyType({ + "Region": "cn-northwest-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443", + }), + }), + "params": MappingProxyType({ + "Region": "cn-northwest-1", + "UseFIPS": False, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.cn-northwest-1.amazonaws.com.cn:8443", + }), + }), + "params": MappingProxyType({ + "Region": "cn-northwest-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region eusc-de-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.eusc-de-east-1.amazonaws.eu:8443", + }), + }), + "params": MappingProxyType({ + "Region": "eusc-de-east-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region eusc-de-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.eusc-de-east-1.amazonaws.eu:8443", + }), + }), + "params": MappingProxyType({ + "Region": "eusc-de-east-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-iso-east-1.c2s.ic.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-iso-east-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-iso-east-1.c2s.ic.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-iso-east-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-isob-east-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-isob-east-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker-fips.eu-isoe-west-1.cloud.adc-e.uk", + }), + }), + "params": MappingProxyType({ + "Region": "eu-isoe-west-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.eu-isoe-west-1.cloud.adc-e.uk", + }), + }), + "params": MappingProxyType({ + "Region": "eu-isoe-west-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-isof-south-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-isof-south-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-gov-west-1.api.aws:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-gov-west-1", + "UseFIPS": True, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.us-gov-west-1.amazonaws.com:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-gov-west-1", + "UseFIPS": True, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-gov-west-1.api.aws:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-gov-west-1", + "UseFIPS": False, + "UseDualStack": True, + }), + }), + MappingProxyType({ + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType({ + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.us-gov-west-1.amazonaws.com:8443", + }), + }), + "params": MappingProxyType({ + "Region": "us-gov-west-1", + "UseFIPS": False, + "UseDualStack": False, + }), + }), + MappingProxyType({ + "documentation": "Missing region", + "expect": MappingProxyType({ + "error": "Invalid Configuration: Missing Region", + }), + }), + ), + "version": "1.0", + })), + Trait.new(id=ShapeID("smithy.rules#endpointRuleSet"), value=MappingProxyType({ + "version": "1.0", + "parameters": MappingProxyType({ + "UseDualStack": MappingProxyType({ + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", + }), + "UseFIPS": MappingProxyType({ + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", + }), + "Endpoint": MappingProxyType({ + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", + }), + "Region": MappingProxyType({ + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", + }), + }), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "isSet", + "argv": ( + MappingProxyType({ + "ref": "Endpoint", + }), + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + ), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + }), + MappingProxyType({ + "conditions": (), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + }), + MappingProxyType({ + "conditions": (), + "endpoint": MappingProxyType({ + "url": MappingProxyType({ + "ref": "Endpoint", + }), + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + ), + "type": "tree", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "isSet", + "argv": ( + MappingProxyType({ + "ref": "Region", + }), + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "aws.partition", + "argv": ( + MappingProxyType({ + "ref": "Region", + }), + ), + "assign": "PartitionResult", + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-cn", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-cn", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-cn", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-cn", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-us-gov", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-us-gov", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-us-gov", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-us-gov", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-b", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-b", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-b", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-b", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-f", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-f", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-f", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-iso-f", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-eusc", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-eusc", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-eusc", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "stringEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "name", + ), + }), + "aws-eusc", + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "endpoint": MappingProxyType({ + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "supportsFIPS", + ), + }), + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "supportsDualStack", + ), + }), + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": (), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + True, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + False, + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "supportsFIPS", + ), + }), + True, + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": (), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseFIPS", + }), + False, + ), + }), + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + MappingProxyType({ + "ref": "UseDualStack", + }), + True, + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": ( + MappingProxyType({ + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType({ + "fn": "getAttr", + "argv": ( + MappingProxyType({ + "ref": "PartitionResult", + }), + "supportsDualStack", + ), + }), + ), + }), + ), + "rules": ( + MappingProxyType({ + "conditions": (), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "endpoint": MappingProxyType({ + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType({}), + "headers": MappingProxyType({}), + }), + "type": "endpoint", + }), + ), + "type": "tree", + }), + ), + "type": "tree", + }), + MappingProxyType({ + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + }), + ), + "type": "tree", + }), + ), + })), + Trait.new(id=ShapeID("aws.api#service"), value=MappingProxyType({ + "sdkId": "SageMaker Runtime HTTP2", + "arnNamespace": "sagemaker", + "cloudFormationName": "SageMakerRuntime", + "endpointPrefix": "runtime.sagemaker", + })), + Trait.new(id=ShapeID("aws.endpoints#standardRegionalEndpoints"), value=MappingProxyType({ + "partitionSpecialCases": MappingProxyType({ + "aws": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-cn": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-us-gov": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-iso": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-iso-b": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-iso-f": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + "aws-eusc": ( + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + }), + MappingProxyType({ + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + }), + ), + }), + })), + Trait.new(id=ShapeID("aws.protocols#restJson1"), value=MappingProxyType({ + "http": ( + "h2", + ), + "eventStreamHttp": ( + "h2", + ), + })), + + ], + +) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py new file mode 100644 index 0000000..34859ce --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py @@ -0,0 +1,24 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from typing import Any + +from smithy_core.auth import AuthOption, AuthParams +from smithy_core.interfaces.auth import AuthOption as AuthOptionProtocol +from smithy_core.shapes import ShapeID + + +class HTTPAuthSchemeResolver: + def resolve_auth_scheme(self, auth_parameters: AuthParams[Any, Any]) -> list[AuthOptionProtocol]: + auth_options: list[AuthOptionProtocol] = [] + + if (option := _generate_sigv4_option(auth_parameters)) is not None: + auth_options.append(option) + + return auth_options + +def _generate_sigv4_option(auth_params: AuthParams[Any, Any]) -> AuthOptionProtocol | None: + return AuthOption( + scheme_id=ShapeID("aws.auth#sigv4"), + identity_properties={}, # type: ignore + signer_properties={} # type: ignore + ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py new file mode 100644 index 0000000..0acd130 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py @@ -0,0 +1,144 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from copy import deepcopy +import logging + +from smithy_core.aio.client import ClientCall, RequestPipeline +from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.exceptions import ExpectationNotMetError +from smithy_core.interceptors import InterceptorChain +from smithy_core.interfaces.retries import RetryStrategy +from smithy_core.retries import RetryStrategyOptions, RetryStrategyResolver +from smithy_core.types import TypedProperties +from smithy_http.plugins import user_agent_plugin + +from .config import Config, Plugin +from .models import ( + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, + RequestStreamEvent, + ResponseStreamEvent, + _ResponseStreamEventDeserializer, +) +from .user_agent import aws_user_agent_plugin + + + +logger = logging.getLogger(__name__) + +class SageMakerRuntimeHTTP2Client: + """ + The Amazon SageMaker AI runtime HTTP/2 API. + + :param config: Optional configuration for the client. Here you can set things like the + endpoint for HTTP services or auth credentials. + + :param plugins: A list of callables that modify the configuration dynamically. These + can be used to set defaults, for example. + """ + def __init__(self, config: Config | None = None, plugins: list[Plugin] | None = None): + self._config = config or Config() + + client_plugins: list[Plugin] = [ + aws_user_agent_plugin, + user_agent_plugin, + ] + if plugins: + client_plugins.extend(plugins) + + for plugin in client_plugins: + plugin(self._config) + + self._retry_strategy_resolver = RetryStrategyResolver() + + async def invoke_endpoint_with_bidirectional_stream( + self, + input: InvokeEndpointWithBidirectionalStreamInput, + plugins: list[Plugin] | None = None + ) -> DuplexEventStream[RequestStreamEvent, ResponseStreamEvent, InvokeEndpointWithBidirectionalStreamOutput]: + """ + Invokes a model endpoint with bidirectional streaming capabilities. This + operation establishes a persistent connection that allows you to send multiple + requests and receive streaming responses from the model in real-time. + + Bidirectional streaming is useful for interactive applications such as chatbots, + real-time translation, or any scenario where you need to maintain a + conversation-like interaction with the model. The connection remains open, + allowing you to send additional input and receive responses without establishing + a new connection for each request. + + For an overview of Amazon SageMaker AI, see `How It Works `_ + . + + Amazon SageMaker AI strips all POST headers except those supported by the API. + Amazon SageMaker AI might add additional headers. You should not rely on the + behavior of headers outside those enumerated in the request syntax. + + Calls to ``InvokeEndpointWithBidirectionalStream`` are authenticated by using Amazon Web Services Signature Version 4. For information, see `Authenticating Requests (Amazon Web Services Signature Version 4) `_ + in the *Amazon S3 API Reference*. + + The bidirectional stream maintains the connection until either the client closes + it or the model indicates completion. Each request and response in the stream is + sent as an event with optional headers for data type and completion state. + + .. note:: + Endpoints are scoped to an individual account, and are not public. The URL does + not contain the account ID, but Amazon SageMaker AI determines the account ID + from the authentication token that is supplied by the caller. + + :param input: The operation's input. + + :param plugins: A list of callables that modify the configuration dynamically. + Changes made by these plugins only apply for the duration of the operation + execution and will not affect any other operation invocations. + """ + operation_plugins: list[Plugin] = [ + + ] + if plugins: + operation_plugins.extend(plugins) + config = deepcopy(self._config) + for plugin in operation_plugins: + plugin(config) + if config.protocol is None or config.transport is None: + raise ExpectationNotMetError("protocol and transport MUST be set on the config to make calls.") + + # Resolve retry strategy from config + if isinstance(config.retry_strategy, RetryStrategy): + retry_strategy = config.retry_strategy + elif isinstance(config.retry_strategy, RetryStrategyOptions): + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + options=config.retry_strategy + ) + elif config.retry_strategy is None: + retry_strategy = await self._retry_strategy_resolver.resolve_retry_strategy( + options=RetryStrategyOptions() + ) + else: + raise TypeError( + f"retry_strategy must be RetryStrategy, RetryStrategyOptions, or None, " + f"got {type(config.retry_strategy).__name__}" + ) + + pipeline = RequestPipeline( + protocol=config.protocol, + transport=config.transport + ) + call = ClientCall( + input=input, + operation=INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + context=TypedProperties({"config": config}), + interceptor=InterceptorChain(config.interceptors), + auth_scheme_resolver=config.auth_scheme_resolver, + supported_auth_schemes=config.auth_schemes, + endpoint_resolver=config.endpoint_resolver, + retry_strategy=retry_strategy, + ) + + return await pipeline.duplex_stream( + call, + RequestStreamEvent, + ResponseStreamEvent, + _ResponseStreamEventDeserializer().deserialize + ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py new file mode 100644 index 0000000..ea3e06a --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py @@ -0,0 +1,166 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from typing import Any, Callable, TypeAlias, Union + +from smithy_aws_core.aio.protocols import RestJsonClientProtocol +from smithy_aws_core.auth import SigV4AuthScheme +from smithy_aws_core.endpoints.standard_regional import ( + StandardRegionalEndpointsResolver as _RegionalResolver, +) +from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties +from smithy_core.aio.endpoints import StaticEndpointResolver +from smithy_core.aio.interfaces import ( + ClientProtocol, + ClientTransport, + EndpointResolver as _EndpointResolver, +) +from smithy_core.aio.interfaces.auth import AuthScheme +from smithy_core.aio.interfaces.identity import IdentityResolver +from smithy_core.interceptors import Interceptor +from smithy_core.interfaces import URI +from smithy_core.interfaces.retries import RetryStrategy +from smithy_core.retries import RetryStrategyOptions +from smithy_core.shapes import ShapeID +from smithy_http.aio.crt import AWSCRTHTTPClient +from smithy_http.interfaces import HTTPRequestConfiguration + +from ._private.schemas import ( + AMAZON_SAGE_MAKER_RUNTIME_HTTP2 as _SCHEMA_AMAZON_SAGE_MAKER_RUNTIME_HTTP2, +) +from .auth import HTTPAuthSchemeResolver +from .models import ( + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, +) + + +_ServiceInterceptor = Union[Interceptor[InvokeEndpointWithBidirectionalStreamInput, InvokeEndpointWithBidirectionalStreamOutput, Any, Any]] +@dataclass(init=False) +class Config: + """Configuration for SageMaker Runtime HTTP2.""" + + auth_scheme_resolver: HTTPAuthSchemeResolver + auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] + aws_access_key_id: str | None + aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + aws_secret_access_key: str | None + aws_session_token: str | None + endpoint_resolver: _EndpointResolver + endpoint_uri: str | URI | None + http_request_config: HTTPRequestConfiguration | None + interceptors: list[_ServiceInterceptor] + protocol: ClientProtocol[Any, Any] | None + region: str | None + retry_strategy: RetryStrategy | RetryStrategyOptions | None + sdk_ua_app_id: str | None + transport: ClientTransport[Any, Any] | None + user_agent_extra: str | None + + def __init__( + self, + *, + auth_scheme_resolver: HTTPAuthSchemeResolver | None = None, + auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None, + aws_access_key_id: str | None = None, + aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = None, + aws_secret_access_key: str | None = None, + aws_session_token: str | None = None, + endpoint_resolver: _EndpointResolver | None = None, + endpoint_uri: str | URI | None = None, + http_request_config: HTTPRequestConfiguration | None = None, + interceptors: list[_ServiceInterceptor] | None = None, + protocol: ClientProtocol[Any, Any] | None = None, + region: str | None = None, + retry_strategy: RetryStrategy | RetryStrategyOptions | None = None, + sdk_ua_app_id: str | None = None, + transport: ClientTransport[Any, Any] | None = None, + user_agent_extra: str | None = None, + ): + """ + Constructor. + + :param auth_scheme_resolver: + An auth scheme resolver that determines the auth scheme for each operation. + + :param auth_schemes: + A map of auth scheme ids to auth schemes. + + :param aws_access_key_id: + The identifier for a secret access key. + + :param aws_credentials_identity_resolver: + Resolves AWS Credentials. Required for operations that use Sigv4 Auth. + + :param aws_secret_access_key: + A secret access key that can be used to sign requests. + + :param aws_session_token: + An access key ID that identifies temporary security credentials. + + :param endpoint_resolver: + The endpoint resolver used to resolve the final endpoint per-operation based on + the configuration. + + :param endpoint_uri: + A static URI to route requests to. + + :param http_request_config: + Configuration for individual HTTP requests. + + :param interceptors: + The list of interceptors, which are hooks that are called during the execution + of a request. + + :param protocol: + The protocol to serialize and deserialize requests with. + + :param region: + The AWS region to connect to. The configured region is used to determine the + service endpoint. + + :param retry_strategy: + The retry strategy or options for configuring retry behavior. Can be either a + configured RetryStrategy or RetryStrategyOptions to create one. + + :param sdk_ua_app_id: + A unique and opaque application ID that is appended to the User-Agent header. + + :param transport: + The transport to use to send requests (e.g. an HTTP client). + + :param user_agent_extra: + Additional suffix to be added to the User-Agent header. + """ + self.auth_scheme_resolver = auth_scheme_resolver or HTTPAuthSchemeResolver() + self.auth_schemes = auth_schemes or { + ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sagemaker"), + } + self.aws_access_key_id = aws_access_key_id + self.aws_credentials_identity_resolver = aws_credentials_identity_resolver + self.aws_secret_access_key = aws_secret_access_key + self.aws_session_token = aws_session_token + self.endpoint_resolver = endpoint_resolver or _RegionalResolver(endpoint_prefix="runtime.sagemaker") + self.endpoint_uri = endpoint_uri + self.http_request_config = http_request_config + self.interceptors = interceptors or [] + self.protocol = protocol or RestJsonClientProtocol(_SCHEMA_AMAZON_SAGE_MAKER_RUNTIME_HTTP2) + self.region = region + self.retry_strategy = retry_strategy + self.sdk_ua_app_id = sdk_ua_app_id + self.transport = transport or AWSCRTHTTPClient() + self.user_agent_extra = user_agent_extra + + def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + """Sets the implementation of an auth scheme. + + Using this method ensures the correct key is used. + + :param scheme: The auth scheme to add. + """ + self.auth_schemes[scheme.scheme_id] = scheme + +# +# A callable that allows customizing the config object on each request. +# +Plugin: TypeAlias = Callable[[Config], None] diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py new file mode 100644 index 0000000..47da969 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py @@ -0,0 +1,776 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass, field +import logging +from typing import Any, ClassVar, Literal, Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import TypeRegistry +from smithy_core.exceptions import ModeledError, SerializationError +from smithy_core.schemas import APIOperation, Schema +from smithy_core.serializers import ShapeSerializer +from smithy_core.shapes import ShapeID + +from ._private.schemas import ( + INPUT_VALIDATION_ERROR as _SCHEMA_INPUT_VALIDATION_ERROR, + INTERNAL_SERVER_ERROR as _SCHEMA_INTERNAL_SERVER_ERROR, + INTERNAL_STREAM_FAILURE as _SCHEMA_INTERNAL_STREAM_FAILURE, + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, + MODEL_ERROR as _SCHEMA_MODEL_ERROR, + MODEL_STREAM_ERROR as _SCHEMA_MODEL_STREAM_ERROR, + REQUEST_PAYLOAD_PART as _SCHEMA_REQUEST_PAYLOAD_PART, + REQUEST_STREAM_EVENT as _SCHEMA_REQUEST_STREAM_EVENT, + RESPONSE_PAYLOAD_PART as _SCHEMA_RESPONSE_PAYLOAD_PART, + RESPONSE_STREAM_EVENT as _SCHEMA_RESPONSE_STREAM_EVENT, + SERVICE_UNAVAILABLE_ERROR as _SCHEMA_SERVICE_UNAVAILABLE_ERROR, +) + + + +logger = logging.getLogger(__name__) + +class ServiceError(ModeledError): + """Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class InputValidationError(ServiceError): + """ + The input fails to satisfy the constraints specified by an AWS service. + """ + + fault: Literal["client", "server"] | None = "client" + + error_code: str | None = None + """ + Error code. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INPUT_VALIDATION_ERROR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["Message"], self.message) + + if self.error_code is not None: + serializer.write_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"], self.error_code) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["Message"]) + + case 1: + kwargs["error_code"] = de.read_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INPUT_VALIDATION_ERROR, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class InternalServerError(ServiceError): + """ + The request processing has failed because of an unknown error, exception or + failure. + """ + + fault: Literal["client", "server"] | None = "server" + + error_code: str | None = None + """ + Error code. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INTERNAL_SERVER_ERROR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["Message"], self.message) + + if self.error_code is not None: + serializer.write_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"], self.error_code) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["Message"]) + + case 1: + kwargs["error_code"] = de.read_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_ERROR, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class InternalStreamFailure(ServiceError): + """ + Internal stream failure that occurs during streaming. + """ + + fault: Literal["client", "server"] | None = "server" + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INTERNAL_STREAM_FAILURE, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"], self.message) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INTERNAL_STREAM_FAILURE, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class RequestPayloadPart: + """ + Request payload part structure. + """ + + bytes_: bytes | None = field(repr=False, default=None) + """ + The payload bytes. + """ + + data_type: str | None = None + """ + Data type header. Can be one of these possible values: "UTF8", "BINARY". + """ + + completion_state: str | None = None + """ + Completion state header. Can be one of these possible values: "PARTIAL", + "COMPLETE". + """ + + p: str | None = None + """ + Padding string for alignment. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_REQUEST_PAYLOAD_PART, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.bytes_ is not None: + serializer.write_blob(_SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"], self.bytes_) + + if self.data_type is not None: + serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"], self.data_type) + + if self.completion_state is not None: + serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"], self.completion_state) + + if self.p is not None: + serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["P"], self.p) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["bytes_"] = de.read_blob(_SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"]) + + case 1: + kwargs["data_type"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"]) + + case 2: + kwargs["completion_state"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"]) + + case 3: + kwargs["p"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["P"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_REQUEST_PAYLOAD_PART, consumer=_consumer) + return kwargs + +@dataclass +class RequestStreamEventPayloadPart: + """ + Payload part event. + """ + + value: RequestPayloadPart + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_REQUEST_STREAM_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_REQUEST_STREAM_EVENT.members["PayloadPart"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=RequestPayloadPart.deserialize(deserializer)) + +@dataclass +class RequestStreamEventUnknown: + """Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + +RequestStreamEvent = Union[RequestStreamEventPayloadPart | RequestStreamEventUnknown] + +""" +Request stream event union. +""" +class _RequestStreamEventDeserializer: + _result: RequestStreamEvent | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> RequestStreamEvent: + self._result = None + deserializer.read_struct(_SCHEMA_REQUEST_STREAM_EVENT, self._consumer) + + if self._result is None: + raise SerializationError("Unions must have exactly one value, but found none.") + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(RequestStreamEventPayloadPart.deserialize(de)) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + def _set_result(self, value: RequestStreamEvent) -> None: + if self._result is not None: + raise SerializationError("Unions must have exactly one value, but found more than one.") + self._result = value + +@dataclass(kw_only=True) +class InvokeEndpointWithBidirectionalStreamInput: + + endpoint_name: str | None = None + """ + The name of the endpoint to invoke. + """ + + target_variant: str | None = None + """ + Target variant for the request. + """ + + model_invocation_path: str | None = None + """ + Model invocation path. + """ + + model_query_string: str | None = None + """ + Model query string. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.endpoint_name is not None: + serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["EndpointName"], self.endpoint_name) + + if self.target_variant is not None: + serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["TargetVariant"], self.target_variant) + + if self.model_invocation_path is not None: + serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelInvocationPath"], self.model_invocation_path) + + if self.model_query_string is not None: + serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelQueryString"], self.model_query_string) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["endpoint_name"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["EndpointName"]) + + case 2: + kwargs["target_variant"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["TargetVariant"]) + + case 3: + kwargs["model_invocation_path"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelInvocationPath"]) + + case 4: + kwargs["model_query_string"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelQueryString"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class ModelStreamError(ServiceError): + """ + Model stream error that occurs during streaming. + """ + + fault: Literal["client", "server"] | None = "client" + + error_code: str | None = None + """ + Error code. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MODEL_STREAM_ERROR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_MODEL_STREAM_ERROR.members["Message"], self.message) + + if self.error_code is not None: + serializer.write_string(_SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"], self.error_code) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_MODEL_STREAM_ERROR.members["Message"]) + + case 1: + kwargs["error_code"] = de.read_string(_SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MODEL_STREAM_ERROR, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class ResponsePayloadPart: + """ + Response payload part structure. + """ + + bytes_: bytes | None = field(repr=False, default=None) + """ + The payload bytes. + """ + + data_type: str | None = None + """ + Data type header. Can be one of these possible values: "UTF8", "BINARY". + """ + + completion_state: str | None = None + """ + Completion state header. Can be one of these possible values: "PARTIAL", + "COMPLETE". + """ + + p: str | None = None + """ + Padding string for alignment. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_PAYLOAD_PART, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.bytes_ is not None: + serializer.write_blob(_SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"], self.bytes_) + + if self.data_type is not None: + serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"], self.data_type) + + if self.completion_state is not None: + serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"], self.completion_state) + + if self.p is not None: + serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["P"], self.p) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["bytes_"] = de.read_blob(_SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"]) + + case 1: + kwargs["data_type"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"]) + + case 2: + kwargs["completion_state"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"]) + + case 3: + kwargs["p"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["P"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_RESPONSE_PAYLOAD_PART, consumer=_consumer) + return kwargs + +@dataclass +class ResponseStreamEventPayloadPart: + """ + Payload part event. + """ + + value: ResponsePayloadPart + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["PayloadPart"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ResponsePayloadPart.deserialize(deserializer)) + +@dataclass +class ResponseStreamEventModelStreamError: + """ + Model stream error event. + """ + + value: ModelStreamError + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["ModelStreamError"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=ModelStreamError.deserialize(deserializer)) + +@dataclass +class ResponseStreamEventInternalStreamFailure: + """ + Internal stream failure event. + """ + + value: InternalStreamFailure + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) + + def serialize_members(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["InternalStreamFailure"], self.value) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(value=InternalStreamFailure.deserialize(deserializer)) + +@dataclass +class ResponseStreamEventUnknown: + """Represents an unknown variant. + + If you receive this value, you will need to update your library to receive the + parsed value. + + This value may not be deliberately sent. + """ + + tag: str + + def serialize(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + def serialize_members(self, serializer: ShapeSerializer): + raise SerializationError("Unknown union variants may not be serialized.") + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + raise NotImplementedError() + +ResponseStreamEvent = Union[ResponseStreamEventPayloadPart | ResponseStreamEventModelStreamError | ResponseStreamEventInternalStreamFailure | ResponseStreamEventUnknown] + +""" +Response stream event union. +""" +class _ResponseStreamEventDeserializer: + _result: ResponseStreamEvent | None = None + + def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStreamEvent: + self._result = None + deserializer.read_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self._consumer) + + if self._result is None: + raise SerializationError("Unions must have exactly one value, but found none.") + + return self._result + + def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + self._set_result(ResponseStreamEventPayloadPart.deserialize(de)) + + case 1: + self._set_result(ResponseStreamEventModelStreamError.deserialize(de)) + + case 2: + self._set_result(ResponseStreamEventInternalStreamFailure.deserialize(de)) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + def _set_result(self, value: ResponseStreamEvent) -> None: + if self._result is not None: + raise SerializationError("Unions must have exactly one value, but found more than one.") + self._result = value + +@dataclass(kw_only=True) +class InvokeEndpointWithBidirectionalStreamOutput: + + invoked_production_variant: str | None = None + """ + The invoked production variant. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.invoked_production_variant is not None: + serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members["InvokedProductionVariant"], self.invoked_production_variant) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 1: + kwargs["invoked_production_variant"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members["InvokedProductionVariant"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class ModelError(ServiceError): + """ + An error occurred while processing the model. + """ + + fault: Literal["client", "server"] | None = "client" + + original_status_code: int | None = None + """ + HTTP status code returned by model. + """ + + original_message: str | None = None + """ + Original error message from the model. + """ + + log_stream_arn: str | None = None + """ + CloudWatch log stream ARN. + """ + + error_code: str | None = None + """ + Error code. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_MODEL_ERROR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_MODEL_ERROR.members["Message"], self.message) + + if self.original_status_code is not None: + serializer.write_integer(_SCHEMA_MODEL_ERROR.members["OriginalStatusCode"], self.original_status_code) + + if self.original_message is not None: + serializer.write_string(_SCHEMA_MODEL_ERROR.members["OriginalMessage"], self.original_message) + + if self.log_stream_arn is not None: + serializer.write_string(_SCHEMA_MODEL_ERROR.members["LogStreamArn"], self.log_stream_arn) + + if self.error_code is not None: + serializer.write_string(_SCHEMA_MODEL_ERROR.members["ErrorCode"], self.error_code) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_MODEL_ERROR.members["Message"]) + + case 1: + kwargs["original_status_code"] = de.read_integer(_SCHEMA_MODEL_ERROR.members["OriginalStatusCode"]) + + case 2: + kwargs["original_message"] = de.read_string(_SCHEMA_MODEL_ERROR.members["OriginalMessage"]) + + case 3: + kwargs["log_stream_arn"] = de.read_string(_SCHEMA_MODEL_ERROR.members["LogStreamArn"]) + + case 4: + kwargs["error_code"] = de.read_string(_SCHEMA_MODEL_ERROR.members["ErrorCode"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_MODEL_ERROR, consumer=_consumer) + return kwargs + +@dataclass(kw_only=True) +class ServiceUnavailableError(ServiceError): + """ + The request has failed due to a temporary failure of the server. + """ + + fault: Literal["client", "server"] | None = "server" + + error_code: str | None = None + """ + Error code. + """ + + def serialize(self, serializer: ShapeSerializer): + serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_ERROR, self) + + def serialize_members(self, serializer: ShapeSerializer): + if self.message is not None: + serializer.write_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"], self.message) + + if self.error_code is not None: + serializer.write_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"], self.error_code) + + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: + return cls(**cls.deserialize_kwargs(deserializer)) + + @classmethod + def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: + kwargs: dict[str, Any] = {} + + def _consumer(schema: Schema, de: ShapeDeserializer) -> None: + match schema.expect_member_index(): + case 0: + kwargs["message"] = de.read_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"]) + + case 1: + kwargs["error_code"] = de.read_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"]) + + case _: + logger.debug("Unexpected member schema: %s", schema) + + deserializer.read_struct(_SCHEMA_SERVICE_UNAVAILABLE_ERROR, consumer=_consumer) + return kwargs + +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = APIOperation( + input = InvokeEndpointWithBidirectionalStreamInput, + output = InvokeEndpointWithBidirectionalStreamOutput, + schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + input_schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, + output_schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, + error_registry = TypeRegistry({ + ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"): InputValidationError, +ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"): InternalServerError, +ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"): InternalStreamFailure, +ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"): ModelError, +ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"): ModelStreamError, +ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"): ServiceUnavailableError, + }), + effective_auth_schemes = [ + ShapeID("aws.auth#sigv4"), + ] +) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/user_agent.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/user_agent.py new file mode 100644 index 0000000..643af39 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/user_agent.py @@ -0,0 +1,17 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from smithy_aws_core.interceptors.user_agent import UserAgentInterceptor + +from . import __version__ +from .config import Config + + +def aws_user_agent_plugin(config: Config): + config.interceptors.append( + UserAgentInterceptor( + ua_suffix=config.user_agent_extra, + ua_app_id=config.sdk_ua_app_id, + sdk_version=__version__, + service_id="SageMaker_Runtime_HTTP2", + ) + ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/tests/__init__.py b/clients/aws-sdk-sagemaker-runtime-http2/tests/__init__.py new file mode 100644 index 0000000..247be3e --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/tests/__init__.py @@ -0,0 +1 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py b/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py new file mode 100644 index 0000000..6cc3a18 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py @@ -0,0 +1,58 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from smithy_core.aio.utils import async_list +from smithy_http import tuples_to_fields +from smithy_http.aio import HTTPResponse as _HTTPResponse +from smithy_http.aio.interfaces import HTTPRequest, HTTPResponse +from smithy_http.interfaces import HTTPClientConfiguration, HTTPRequestConfiguration + +from aws_sdk_sagemaker_runtime_http2.models import ServiceError + + +class TestHttpServiceError(ServiceError): + """A test error that subclasses the service-error for protocol tests.""" + + def __init__(self, request: HTTPRequest): + self.request = request + +class RequestTestHTTPClient: + """An asynchronous HTTP client solely for testing purposes.""" + + TIMEOUT_EXCEPTIONS = () + + def __init__(self, *, client_config: HTTPClientConfiguration | None = None): + self._client_config = client_config + + async def send( + self, request: HTTPRequest, *, request_config: HTTPRequestConfiguration | None = None + ) -> HTTPResponse: + # Raise the exception with the request object to bypass actual request handling + raise TestHttpServiceError(request) + +class ResponseTestHTTPClient: + """An asynchronous HTTP client solely for testing purposes.""" + + TIMEOUT_EXCEPTIONS = () + + def __init__( + self, + *, + client_config: HTTPClientConfiguration | None = None, + status: int = 200, + headers: list[tuple[str, str]] | None = None, + body: bytes = b"", + ): + self._client_config = client_config + self.status = status + self.fields = tuples_to_fields(headers or []) + self.body = body + + async def send( + self, request: HTTPRequest, *, request_config: HTTPRequestConfiguration | None = None + ) -> _HTTPResponse: + # Pre-construct the response from the request and return it + return _HTTPResponse( + status=self.status, + fields=self.fields, + body=async_list([self.body]), + ) diff --git a/codegen/aws-models/sagemaker-runtime-http2.json b/codegen/aws-models/sagemaker-runtime-http2.json new file mode 100644 index 0000000..28baf1f --- /dev/null +++ b/codegen/aws-models/sagemaker-runtime-http2.json @@ -0,0 +1,2461 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.sagemakerruntimehttp2#AmazonSageMakerRuntimeHttp2": { + "type": "service", + "version": "2025-10-01", + "operations": [ + { + "target": "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "SageMaker Runtime HTTP2", + "arnNamespace": "sagemaker", + "cloudFormationName": "SageMakerRuntime", + "endpointPrefix": "runtime.sagemaker" + }, + "aws.auth#sigv4": { + "name": "sagemaker" + }, + "aws.endpoints#standardRegionalEndpoints": { + "partitionSpecialCases": { + "aws": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-cn": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-us-gov": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-iso": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-iso-b": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-iso-f": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ], + "aws-eusc": [ + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": false, + "dualStack": false + }, + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": false, + "dualStack": true + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": true, + "dualStack": false + }, + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": true, + "dualStack": true + } + ] + } + }, + "aws.protocols#restJson1": { + "http": [ + "h2" + ], + "eventStreamHttp": [ + "h2" + ] + }, + "smithy.api#documentation": "

The Amazon SageMaker AI runtime HTTP/2 API.

", + "smithy.api#title": "Amazon SageMaker Runtime HTTP2", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "string" + }, + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "string" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-cn" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-cn" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-cn" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-cn" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-us-gov" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-us-gov" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-us-gov" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-us-gov" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-b" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-b" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-b" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-b" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-f" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-f" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-f" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-iso-f" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-eusc" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-eusc" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-eusc" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "stringEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "name" + ] + }, + "aws-eusc" + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "endpoint": { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + false + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "endpoint": { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For custom endpoint with region not set and fips disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": false + } + }, + { + "documentation": "For custom endpoint with fips enabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": true + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-east-1.api.aws:8443" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-east-1.amazonaws.com:8443" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-east-1.api.aws:8443" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-east-1.amazonaws.com:8443" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.cn-northwest-1.amazonaws.com.cn:8443" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.cn-northwest-1.amazonaws.com.cn:8443" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region eusc-de-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.eusc-de-east-1.amazonaws.eu:8443" + } + }, + "params": { + "Region": "eusc-de-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region eusc-de-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.eusc-de-east-1.amazonaws.eu:8443" + } + }, + "params": { + "Region": "eusc-de-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-iso-east-1.c2s.ic.gov:8443" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-iso-east-1.c2s.ic.gov:8443" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker-fips.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-gov-west-1.api.aws:8443" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime-fips.sagemaker.us-gov-west-1.amazonaws.com:8443" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-gov-west-1.api.aws:8443" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://runtime.sagemaker.us-gov-west-1.amazonaws.com:8443" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.sagemakerruntimehttp2#InputValidationError": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + }, + "ErrorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error code.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The input fails to satisfy the constraints specified by an AWS service.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.sagemakerruntimehttp2#InternalServerError": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + }, + "ErrorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error code.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The request processing has failed because of an unknown error, exception or failure.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Internal stream failure that occurs during streaming.

", + "smithy.api#error": "server" + } + }, + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream": { + "type": "operation", + "input": { + "target": "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput" + }, + "output": { + "target": "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput" + }, + "errors": [ + { + "target": "com.amazonaws.sagemakerruntimehttp2#InputValidationError" + }, + { + "target": "com.amazonaws.sagemakerruntimehttp2#InternalServerError" + }, + { + "target": "com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure" + }, + { + "target": "com.amazonaws.sagemakerruntimehttp2#ModelError" + }, + { + "target": "com.amazonaws.sagemakerruntimehttp2#ModelStreamError" + }, + { + "target": "com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError" + } + ], + "traits": { + "smithy.api#documentation": "

Invokes a model endpoint with bidirectional streaming capabilities. This operation establishes a persistent connection that allows you to send multiple requests and receive streaming responses from the model in real-time.

Bidirectional streaming is useful for interactive applications such as chatbots, real-time translation, or any scenario where you need to maintain a conversation-like interaction with the model. The connection remains open, allowing you to send additional input and receive responses without establishing a new connection for each request.

For an overview of Amazon SageMaker AI, see How It Works.

Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.

Calls to InvokeEndpointWithBidirectionalStream are authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.

The bidirectional stream maintains the connection until either the client closes it or the model indicates completion. Each request and response in the stream is sent as an event with optional headers for data type and completion state.

Endpoints are scoped to an individual account, and are not public. The URL does not contain the account ID, but Amazon SageMaker AI determines the account ID from the authentication token that is supplied by the caller.

", + "smithy.api#http": { + "method": "POST", + "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream" + } + } + }, + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput": { + "type": "structure", + "members": { + "EndpointName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the endpoint to invoke.

", + "smithy.api#httpLabel": {}, + "smithy.api#length": { + "max": 63 + }, + "smithy.api#pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", + "smithy.api#required": {} + } + }, + "Body": { + "target": "com.amazonaws.sagemakerruntimehttp2#RequestStreamEvent", + "traits": { + "smithy.api#documentation": "

The request payload stream.

", + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + }, + "TargetVariant": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Target variant for the request.

", + "smithy.api#httpHeader": "X-Amzn-SageMaker-Target-Variant", + "smithy.api#length": { + "max": 63 + }, + "smithy.api#pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*" + } + }, + "ModelInvocationPath": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Model invocation path.

", + "smithy.api#httpHeader": "X-Amzn-SageMaker-Model-Invocation-Path", + "smithy.api#length": { + "max": 100 + }, + "smithy.api#pattern": "^[A-Za-z0-9\\-._]+(?:/[A-Za-z0-9\\-._]+)*$" + } + }, + "ModelQueryString": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Model query string.

", + "smithy.api#httpHeader": "X-Amzn-SageMaker-Model-Query-String", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+(?:&[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+)*$" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput": { + "type": "structure", + "members": { + "Body": { + "target": "com.amazonaws.sagemakerruntimehttp2#ResponseStreamEvent", + "traits": { + "smithy.api#documentation": "

The response payload stream.

", + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + }, + "InvokedProductionVariant": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The invoked production variant.

", + "smithy.api#httpHeader": "X-Amzn-Invoked-Production-Variant", + "smithy.api#length": { + "max": 1024 + }, + "smithy.api#pattern": "\\p{ASCII}*" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.sagemakerruntimehttp2#ModelError": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + }, + "OriginalStatusCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

HTTP status code returned by model.

" + } + }, + "OriginalMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Original error message from the model.

" + } + }, + "LogStreamArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

CloudWatch log stream ARN.

" + } + }, + "ErrorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error code.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An error occurred while processing the model.

", + "smithy.api#error": "client", + "smithy.api#httpError": 424 + } + }, + "com.amazonaws.sagemakerruntimehttp2#ModelStreamError": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + }, + "ErrorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error code.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Model stream error that occurs during streaming.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.sagemakerruntimehttp2#RequestPayloadPart": { + "type": "structure", + "members": { + "Bytes": { + "target": "com.amazonaws.sagemakerruntimehttp2#SensitiveBlob", + "traits": { + "smithy.api#documentation": "

The payload bytes.

", + "smithy.api#eventPayload": {} + } + }, + "DataType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Data type header. Can be one of these possible values: \"UTF8\", \"BINARY\".

", + "smithy.api#eventHeader": {}, + "smithy.api#pattern": "^(UTF8)$|^(BINARY)$" + } + }, + "CompletionState": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Completion state header. Can be one of these possible values: \"PARTIAL\", \"COMPLETE\".

", + "smithy.api#eventHeader": {}, + "smithy.api#pattern": "^(PARTIAL)$|^(COMPLETE)$" + } + }, + "P": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Padding string for alignment.

", + "smithy.api#eventHeader": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Request payload part structure.

" + } + }, + "com.amazonaws.sagemakerruntimehttp2#RequestStreamEvent": { + "type": "union", + "members": { + "PayloadPart": { + "target": "com.amazonaws.sagemakerruntimehttp2#RequestPayloadPart", + "traits": { + "smithy.api#documentation": "

Payload part event.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Request stream event union.

", + "smithy.api#streaming": {} + } + }, + "com.amazonaws.sagemakerruntimehttp2#ResponsePayloadPart": { + "type": "structure", + "members": { + "Bytes": { + "target": "com.amazonaws.sagemakerruntimehttp2#SensitiveBlob", + "traits": { + "smithy.api#documentation": "

The payload bytes.

", + "smithy.api#eventPayload": {} + } + }, + "DataType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Data type header. Can be one of these possible values: \"UTF8\", \"BINARY\".

", + "smithy.api#eventHeader": {}, + "smithy.api#pattern": "^(UTF8)$|^(BINARY)$" + } + }, + "CompletionState": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Completion state header. Can be one of these possible values: \"PARTIAL\", \"COMPLETE\".

", + "smithy.api#eventHeader": {}, + "smithy.api#pattern": "^(PARTIAL)$|^(COMPLETE)$" + } + }, + "P": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Padding string for alignment.

", + "smithy.api#eventHeader": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Response payload part structure.

" + } + }, + "com.amazonaws.sagemakerruntimehttp2#ResponseStreamEvent": { + "type": "union", + "members": { + "PayloadPart": { + "target": "com.amazonaws.sagemakerruntimehttp2#ResponsePayloadPart", + "traits": { + "smithy.api#documentation": "

Payload part event.

" + } + }, + "ModelStreamError": { + "target": "com.amazonaws.sagemakerruntimehttp2#ModelStreamError", + "traits": { + "smithy.api#documentation": "

Model stream error event.

" + } + }, + "InternalStreamFailure": { + "target": "com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure", + "traits": { + "smithy.api#documentation": "

Internal stream failure event.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Response stream event union.

", + "smithy.api#streaming": {} + } + }, + "com.amazonaws.sagemakerruntimehttp2#SensitiveBlob": { + "type": "blob", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error message.

" + } + }, + "ErrorCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Error code.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The request has failed due to a temporary failure of the server.

", + "smithy.api#error": "server", + "smithy.api#httpError": 503 + } + } + } +} \ No newline at end of file From 2be0176e8742241e69bd6ca43507f2809f2f5315 Mon Sep 17 00:00:00 2001 From: SamRemis Date: Fri, 21 Nov 2025 18:20:26 -0500 Subject: [PATCH 2/2] run ruff --- .../aws-sdk-sagemaker-runtime-http2/README.md | 5 +- .../docs/conf.py | 28 +- .../_private/schemas.py | 5411 ++++++++++------- .../aws_sdk_sagemaker_runtime_http2/auth.py | 11 +- .../aws_sdk_sagemaker_runtime_http2/client.py | 35 +- .../aws_sdk_sagemaker_runtime_http2/config.py | 32 +- .../aws_sdk_sagemaker_runtime_http2/models.py | 366 +- .../tests/test_protocol.py | 16 +- 8 files changed, 3525 insertions(+), 2379 deletions(-) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/README.md b/clients/aws-sdk-sagemaker-runtime-http2/README.md index 2c4de60..fa1cda1 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/README.md +++ b/clients/aws-sdk-sagemaker-runtime-http2/README.md @@ -1,13 +1,14 @@ ## Amazon SageMaker Runtime HTTP2 Client -The aws_sdk_sagemaker_runtime_http2 client is still under active developement. +The `aws_sdk_sagemaker_runtime_http2` client is still under active developement. Changes may result in breaking changes prior to the release of version 1.0.0. + ### Documentation Documentation is available in the `/docs` directory of this package. Pages can be built into portable HTML files for the time being. You can -follow the instructions in the docs [README.md](https://github.com/awslabs/aws-sdk-python/blob/main/clients/aws-sdk-sagemaker-runtime-http2/docs/README.md). +follow the instructions in the docs [README.md](https://github.com/awslabs/aws-sdk-python/blob/main/clients/aws-sdk-sagemaker-runtime-http/docs/README.md). For high-level documentation, you can view the [`dev-guide`](https://github.com/awslabs/aws-sdk-python/tree/main/dev-guide) at the top level of this repo. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py b/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py index 8ce0f7a..0ff545c 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/docs/conf.py @@ -2,29 +2,23 @@ import os import sys -sys.path.insert(0, os.path.abspath('..')) -project = 'Amazon SageMaker Runtime HTTP2' -author = 'Amazon Web Services' -release = '0.1.0' +sys.path.insert(0, os.path.abspath("..")) -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.viewcode', -] +project = "Amazon SageMaker Runtime HTTP2" +author = "Amazon Web Services" +release = "0.1.0" -templates_path = ['_templates'] +extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"] + +templates_path = ["_templates"] exclude_patterns = [] autodoc_default_options = { - 'exclude-members': 'deserialize,deserialize_kwargs,serialize,serialize_members' + "exclude-members": "deserialize,deserialize_kwargs,serialize,serialize_members" } -html_theme = 'pydata_sphinx_theme' -html_theme_options = { - "logo": { - "text": "Amazon SageMaker Runtime HTTP2", - } -} +html_theme = "pydata_sphinx_theme" +html_theme_options = {"logo": {"text": "Amazon SageMaker Runtime HTTP2"}} -autodoc_typehints = 'description' +autodoc_typehints = "description" diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py index ea4eebc..6701d12 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py @@ -10,2433 +10,3360 @@ INPUT_VALIDATION_ERROR = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"), - traits=[ Trait.new(id=ShapeID("smithy.api#error"), value="client"), Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "Message": { - "target": STRING, - }, - - "ErrorCode": { - "target": STRING, - }, - - } + members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, ) INTERNAL_SERVER_ERROR = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"), - traits=[ Trait.new(id=ShapeID("smithy.api#error"), value="server"), Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "Message": { - "target": STRING, - }, - - "ErrorCode": { - "target": STRING, - }, - - } + members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, ) INTERNAL_STREAM_FAILURE = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"), - - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - - ], - members={ - "Message": { - "target": STRING, - }, - - } + traits=[Trait.new(id=ShapeID("smithy.api#error"), value="server")], + members={"Message": {"target": STRING}}, ) SENSITIVE_BLOB = Schema( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#SensitiveBlob"), shape_type=ShapeType.BLOB, - traits=[ - Trait.new(id=ShapeID("smithy.api#sensitive")), - - ], - + traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) REQUEST_PAYLOAD_PART = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestPayloadPart"), - members={ "Bytes": { "target": SENSITIVE_BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventPayload")), - - ], + "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], }, - "DataType": { "target": STRING, "traits": [ Trait.new(id=ShapeID("smithy.api#eventHeader")), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$"), - + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$" + ), ], }, - "CompletionState": { "target": STRING, "traits": [ Trait.new(id=ShapeID("smithy.api#eventHeader")), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$"), - + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$" + ), ], }, - "P": { "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventHeader")), - - ], + "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], }, - - } + }, ) REQUEST_STREAM_EVENT = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestStreamEvent"), shape_type=ShapeType.UNION, - traits=[ - Trait.new(id=ShapeID("smithy.api#streaming")), - - ], - members={ - "PayloadPart": { - "target": REQUEST_PAYLOAD_PART, - }, - - } + traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], + members={"PayloadPart": {"target": REQUEST_PAYLOAD_PART}}, ) INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput"), - - traits=[ - Trait.new(id=ShapeID("smithy.api#input")), - - ], + id=ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput" + ), + traits=[Trait.new(id=ShapeID("smithy.api#input"))], members={ "EndpointName": { "target": STRING, "traits": [ Trait.new(id=ShapeID("smithy.api#required")), Trait.new(id=ShapeID("smithy.api#httpLabel")), - Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ - "max": 63, - })), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), - + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 63}) + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*", + ), ], }, - "Body": { "target": REQUEST_STREAM_EVENT, "traits": [ Trait.new(id=ShapeID("smithy.api#required")), Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], }, - "TargetVariant": { "target": STRING, "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Target-Variant"), - Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ - "max": 63, - })), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), - + Trait.new( + id=ShapeID("smithy.api#httpHeader"), + value="X-Amzn-SageMaker-Target-Variant", + ), + Trait.new( + id=ShapeID("smithy.api#length"), value=MappingProxyType({"max": 63}) + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[a-zA-Z0-9](-*[a-zA-Z0-9])*", + ), ], }, - "ModelInvocationPath": { "target": STRING, "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Model-Invocation-Path"), - Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ - "max": 100, - })), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^[A-Za-z0-9\\-._]+(?:/[A-Za-z0-9\\-._]+)*$"), - + Trait.new( + id=ShapeID("smithy.api#httpHeader"), + value="X-Amzn-SageMaker-Model-Invocation-Path", + ), + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"max": 100}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[A-Za-z0-9\\-._]+(?:/[A-Za-z0-9\\-._]+)*$", + ), ], }, - "ModelQueryString": { "target": STRING, "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-SageMaker-Model-Query-String"), - Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ - "max": 2048, - })), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+(?:&[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+)*$"), - + Trait.new( + id=ShapeID("smithy.api#httpHeader"), + value="X-Amzn-SageMaker-Model-Query-String", + ), + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"max": 2048}), + ), + Trait.new( + id=ShapeID("smithy.api#pattern"), + value="^[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+(?:&[a-zA-Z0-9][A-Za-z0-9_-]*=(?:[A-Za-z0-9._~\\-]|%[0-9A-Fa-f]{2})+)*$", + ), ], }, - - } + }, ) MODEL_STREAM_ERROR = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"), - - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - - ], - members={ - "Message": { - "target": STRING, - }, - - "ErrorCode": { - "target": STRING, - }, - - } + traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], + members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, ) RESPONSE_PAYLOAD_PART = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponsePayloadPart"), - members={ "Bytes": { "target": SENSITIVE_BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventPayload")), - - ], + "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], }, - "DataType": { "target": STRING, "traits": [ Trait.new(id=ShapeID("smithy.api#eventHeader")), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$"), - + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^(UTF8)$|^(BINARY)$" + ), ], }, - "CompletionState": { "target": STRING, "traits": [ Trait.new(id=ShapeID("smithy.api#eventHeader")), - Trait.new(id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$"), - + Trait.new( + id=ShapeID("smithy.api#pattern"), value="^(PARTIAL)$|^(COMPLETE)$" + ), ], }, - "P": { "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventHeader")), - - ], + "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], }, - - } + }, ) RESPONSE_STREAM_EVENT = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponseStreamEvent"), shape_type=ShapeType.UNION, - traits=[ - Trait.new(id=ShapeID("smithy.api#streaming")), - - ], + traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], members={ - "PayloadPart": { - "target": RESPONSE_PAYLOAD_PART, - }, - - "ModelStreamError": { - "target": MODEL_STREAM_ERROR, - }, - - "InternalStreamFailure": { - "target": INTERNAL_STREAM_FAILURE, - }, - - } + "PayloadPart": {"target": RESPONSE_PAYLOAD_PART}, + "ModelStreamError": {"target": MODEL_STREAM_ERROR}, + "InternalStreamFailure": {"target": INTERNAL_STREAM_FAILURE}, + }, ) INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput"), - - traits=[ - Trait.new(id=ShapeID("smithy.api#output")), - - ], + id=ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput" + ), + traits=[Trait.new(id=ShapeID("smithy.api#output"))], members={ "Body": { "target": RESPONSE_STREAM_EVENT, "traits": [ Trait.new(id=ShapeID("smithy.api#required")), Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], }, - "InvokedProductionVariant": { "target": STRING, "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Invoked-Production-Variant"), - Trait.new(id=ShapeID("smithy.api#length"), value=MappingProxyType({ - "max": 1024, - })), + Trait.new( + id=ShapeID("smithy.api#httpHeader"), + value="X-Amzn-Invoked-Production-Variant", + ), + Trait.new( + id=ShapeID("smithy.api#length"), + value=MappingProxyType({"max": 1024}), + ), Trait.new(id=ShapeID("smithy.api#pattern"), value="\\p{ASCII}*"), - ], }, - - } + }, ) MODEL_ERROR = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"), - traits=[ Trait.new(id=ShapeID("smithy.api#error"), value="client"), Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], members={ - "Message": { - "target": STRING, - }, - - "OriginalStatusCode": { - "target": INTEGER, - }, - - "OriginalMessage": { - "target": STRING, - }, - - "LogStreamArn": { - "target": STRING, - }, - - "ErrorCode": { - "target": STRING, - }, - - } + "Message": {"target": STRING}, + "OriginalStatusCode": {"target": INTEGER}, + "OriginalMessage": {"target": STRING}, + "LogStreamArn": {"target": STRING}, + "ErrorCode": {"target": STRING}, + }, ) SERVICE_UNAVAILABLE_ERROR = Schema.collection( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"), - traits=[ Trait.new(id=ShapeID("smithy.api#error"), value="server"), Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={ - "Message": { - "target": STRING, - }, - - "ErrorCode": { - "target": STRING, - }, - - } + members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, ) INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = Schema( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream"), + id=ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream" + ), shape_type=ShapeType.OPERATION, traits=[ - Trait.new(id=ShapeID("smithy.api#http"), value=MappingProxyType({ - "method": "POST", - "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream", - })), - + Trait.new( + id=ShapeID("smithy.api#http"), + value=MappingProxyType( + { + "method": "POST", + "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream", + } + ), + ) ], - ) AMAZON_SAGE_MAKER_RUNTIME_HTTP2 = Schema( id=ShapeID("com.amazonaws.sagemakerruntimehttp2#AmazonSageMakerRuntimeHttp2"), shape_type=ShapeType.SERVICE, traits=[ - Trait.new(id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({ - "name": "sagemaker", - })), - Trait.new(id=ShapeID("smithy.api#title"), value="Amazon SageMaker Runtime HTTP2"), - Trait.new(id=ShapeID("smithy.rules#endpointTests"), value=MappingProxyType({ - "testCases": ( - MappingProxyType({ - "documentation": "For custom endpoint with region not set and fips disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://example.com", - }), - }), - "params": MappingProxyType({ - "Endpoint": "https://example.com", - "UseFIPS": False, - }), - }), - MappingProxyType({ - "documentation": "For custom endpoint with fips enabled", - "expect": MappingProxyType({ - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - }), - "params": MappingProxyType({ - "Endpoint": "https://example.com", - "UseFIPS": True, - }), - }), - MappingProxyType({ - "documentation": "For custom endpoint with fips disabled and dualstack enabled", - "expect": MappingProxyType({ - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - }), - "params": MappingProxyType({ - "Endpoint": "https://example.com", - "UseFIPS": False, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-east-1.api.aws:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-east-1", - "UseFIPS": True, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-east-1.amazonaws.com:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-east-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-east-1.api.aws:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-east-1", - "UseFIPS": False, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-east-1.amazonaws.com:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-east-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443", - }), - }), - "params": MappingProxyType({ - "Region": "cn-northwest-1", - "UseFIPS": True, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.cn-northwest-1.amazonaws.com.cn:8443", - }), - }), - "params": MappingProxyType({ - "Region": "cn-northwest-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443", - }), - }), - "params": MappingProxyType({ - "Region": "cn-northwest-1", - "UseFIPS": False, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.cn-northwest-1.amazonaws.com.cn:8443", - }), - }), - "params": MappingProxyType({ - "Region": "cn-northwest-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region eusc-de-east-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.eusc-de-east-1.amazonaws.eu:8443", - }), - }), - "params": MappingProxyType({ - "Region": "eusc-de-east-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region eusc-de-east-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.eusc-de-east-1.amazonaws.eu:8443", - }), - }), - "params": MappingProxyType({ - "Region": "eusc-de-east-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-iso-east-1.c2s.ic.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-iso-east-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-iso-east-1.c2s.ic.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-iso-east-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-isob-east-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-isob-east-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker-fips.eu-isoe-west-1.cloud.adc-e.uk", - }), - }), - "params": MappingProxyType({ - "Region": "eu-isoe-west-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.eu-isoe-west-1.cloud.adc-e.uk", - }), - }), - "params": MappingProxyType({ - "Region": "eu-isoe-west-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-isof-south-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-isof-south-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-gov-west-1.api.aws:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-gov-west-1", - "UseFIPS": True, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.us-gov-west-1.amazonaws.com:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-gov-west-1", - "UseFIPS": True, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-gov-west-1.api.aws:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-gov-west-1", - "UseFIPS": False, - "UseDualStack": True, - }), - }), - MappingProxyType({ - "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", - "expect": MappingProxyType({ - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.us-gov-west-1.amazonaws.com:8443", - }), - }), - "params": MappingProxyType({ - "Region": "us-gov-west-1", - "UseFIPS": False, - "UseDualStack": False, - }), - }), - MappingProxyType({ - "documentation": "Missing region", - "expect": MappingProxyType({ - "error": "Invalid Configuration: Missing Region", - }), - }), - ), - "version": "1.0", - })), - Trait.new(id=ShapeID("smithy.rules#endpointRuleSet"), value=MappingProxyType({ - "version": "1.0", - "parameters": MappingProxyType({ - "UseDualStack": MappingProxyType({ - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - }), - "UseFIPS": MappingProxyType({ - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - }), - "Endpoint": MappingProxyType({ - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - }), - "Region": MappingProxyType({ - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - }), - }), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "isSet", - "argv": ( - MappingProxyType({ - "ref": "Endpoint", - }), - ), - }), + Trait.new( + id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "sagemaker"}) + ), + Trait.new( + id=ShapeID("smithy.api#title"), value="Amazon SageMaker Runtime HTTP2" + ), + Trait.new( + id=ShapeID("smithy.rules#endpointTests"), + value=MappingProxyType( + { + "testCases": ( + MappingProxyType( + { + "documentation": "For custom endpoint with region not set and fips disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + {"url": "https://example.com"} + ) + } + ), + "params": MappingProxyType( + { + "Endpoint": "https://example.com", + "UseFIPS": False, + } + ), + } ), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - ), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - }), - MappingProxyType({ - "conditions": (), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - }), - MappingProxyType({ - "conditions": (), - "endpoint": MappingProxyType({ - "url": MappingProxyType({ - "ref": "Endpoint", - }), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), + MappingProxyType( + { + "documentation": "For custom endpoint with fips enabled", + "expect": MappingProxyType( + { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + } ), - "type": "tree", - }), + "params": MappingProxyType( + {"Endpoint": "https://example.com", "UseFIPS": True} + ), + } + ), + MappingProxyType( + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": MappingProxyType( + { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + } + ), + "params": MappingProxyType( + { + "Endpoint": "https://example.com", + "UseFIPS": False, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-east-1.api.aws:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": True, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-east-1.amazonaws.com:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-east-1.api.aws:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": False, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-east-1.amazonaws.com:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-east-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "cn-northwest-1", + "UseFIPS": True, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.cn-northwest-1.amazonaws.com.cn:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "cn-northwest-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.cn-northwest-1.api.amazonwebservices.com.cn:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "cn-northwest-1", + "UseFIPS": False, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.cn-northwest-1.amazonaws.com.cn:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "cn-northwest-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region eusc-de-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.eusc-de-east-1.amazonaws.eu:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "eusc-de-east-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region eusc-de-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.eusc-de-east-1.amazonaws.eu:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "eusc-de-east-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-iso-east-1.c2s.ic.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-iso-east-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-iso-east-1.c2s.ic.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-iso-east-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-isob-east-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-isob-east-1.sc2s.sgov.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-isob-east-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker-fips.eu-isoe-west-1.cloud.adc-e.uk" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "eu-isoe-west-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.eu-isoe-west-1.cloud.adc-e.uk" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "eu-isoe-west-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-isof-south-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-isof-south-1.csp.hci.ic.gov:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-isof-south-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-gov-west-1.api.aws:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-gov-west-1", + "UseFIPS": True, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.us-gov-west-1.amazonaws.com:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-gov-west-1", + "UseFIPS": True, + "UseDualStack": False, + } + ), + } ), - "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "rules": ( - MappingProxyType({ + MappingProxyType( + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-gov-west-1.api.aws:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-gov-west-1", + "UseFIPS": False, + "UseDualStack": True, + } + ), + } + ), + MappingProxyType( + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", + "expect": MappingProxyType( + { + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.us-gov-west-1.amazonaws.com:8443" + } + ) + } + ), + "params": MappingProxyType( + { + "Region": "us-gov-west-1", + "UseFIPS": False, + "UseDualStack": False, + } + ), + } + ), + MappingProxyType( + { + "documentation": "Missing region", + "expect": MappingProxyType( + {"error": "Invalid Configuration: Missing Region"} + ), + } + ), + ), + "version": "1.0", + } + ), + ), + Trait.new( + id=ShapeID("smithy.rules#endpointRuleSet"), + value=MappingProxyType( + { + "version": "1.0", + "parameters": MappingProxyType( + { + "UseDualStack": MappingProxyType( + { + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", + } + ), + "UseFIPS": MappingProxyType( + { + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", + } + ), + "Endpoint": MappingProxyType( + { + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", + } + ), + "Region": MappingProxyType( + { + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", + } + ), + } + ), + "rules": ( + MappingProxyType( + { "conditions": ( - MappingProxyType({ - "fn": "isSet", - "argv": ( - MappingProxyType({ - "ref": "Region", - }), - ), - }), + MappingProxyType( + { + "fn": "isSet", + "argv": ( + MappingProxyType({"ref": "Endpoint"}), + ), + } + ), ), "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "aws.partition", - "argv": ( - MappingProxyType({ - "ref": "Region", - }), - ), - "assign": "PartitionResult", - }), - ), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws", - ), - }), - MappingProxyType({ + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { "fn": "booleanEquals", "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, + MappingProxyType( + {"ref": "UseFIPS"} + ), + True, ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, + } + ), + ), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), ), - }), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType( + {"ref": "Endpoint"} ), - }), - "aws", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } ), - }), + "type": "endpoint", + } ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-cn", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-cn", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-cn", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-cn", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-us-gov", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-us-gov", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-us-gov", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-us-gov", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-b", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-b", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-b", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-b", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-f", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-f", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-f", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-iso-f", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-eusc", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-eusc", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-eusc", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "stringEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "name", - ), - }), - "aws-eusc", - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "endpoint": MappingProxyType({ - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), - ), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - True, - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "supportsFIPS", - ), - }), - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - True, - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "supportsDualStack", - ), - }), - ), - }), - ), - "rules": ( - MappingProxyType({ - "conditions": (), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - ), - "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - }), - ), - "type": "tree", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - True, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - False, - ), - }), - ), - "rules": ( - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "supportsFIPS", - ), - }), - True, - ), - }), - ), - "rules": ( - MappingProxyType({ - "conditions": (), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - ), - "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - }), - ), - "type": "tree", - }), - MappingProxyType({ - "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseFIPS", - }), - False, - ), - }), - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - MappingProxyType({ - "ref": "UseDualStack", - }), - True, - ), - }), + ), + "type": "tree", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": ( + MappingProxyType( + {"ref": "Region"} + ), + ), + } ), - "rules": ( - MappingProxyType({ + ), + "rules": ( + MappingProxyType( + { "conditions": ( - MappingProxyType({ - "fn": "booleanEquals", - "argv": ( - True, - MappingProxyType({ - "fn": "getAttr", - "argv": ( - MappingProxyType({ - "ref": "PartitionResult", - }), - "supportsDualStack", - ), - }), - ), - }), + MappingProxyType( + { + "fn": "aws.partition", + "argv": ( + MappingProxyType( + { + "ref": "Region" + } + ), + ), + "assign": "PartitionResult", + } + ), ), "rules": ( - MappingProxyType({ - "conditions": (), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "name", + ), + } + ), + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsFIPS", + ), + } + ), + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsDualStack", + ), + } + ), + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + False, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsFIPS", + ), + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseFIPS" + } + ), + False, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "ref": "UseDualStack" + } + ), + True, + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": ( + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + True, + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + { + "ref": "PartitionResult" + } + ), + "supportsDualStack", + ), + } + ), + ), + } + ), + ), + "rules": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {} + ), + "headers": MappingProxyType( + {} + ), + } + ), + "type": "endpoint", + } + ), ), "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - }), + } ), - "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "endpoint": MappingProxyType({ - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - }), - "type": "endpoint", - }), - ), - "type": "tree", - }), + ), + "type": "tree", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), ), "type": "tree", - }), - MappingProxyType({ - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - }), + } ), - "type": "tree", - }), - ), - })), - Trait.new(id=ShapeID("aws.api#service"), value=MappingProxyType({ - "sdkId": "SageMaker Runtime HTTP2", - "arnNamespace": "sagemaker", - "cloudFormationName": "SageMakerRuntime", - "endpointPrefix": "runtime.sagemaker", - })), - Trait.new(id=ShapeID("aws.endpoints#standardRegionalEndpoints"), value=MappingProxyType({ - "partitionSpecialCases": MappingProxyType({ - "aws": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - "aws-cn": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - "aws-us-gov": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), ), - "aws-iso": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - "aws-iso-b": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - "aws-iso-f": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - "aws-eusc": ( - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", - "fips": False, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", - "fips": False, - "dualStack": True, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", - "fips": True, - "dualStack": False, - }), - MappingProxyType({ - "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", - "fips": True, - "dualStack": True, - }), - ), - }), - })), - Trait.new(id=ShapeID("aws.protocols#restJson1"), value=MappingProxyType({ - "http": ( - "h2", - ), - "eventStreamHttp": ( - "h2", - ), - })), - + } + ), + ), + Trait.new( + id=ShapeID("aws.api#service"), + value=MappingProxyType( + { + "sdkId": "SageMaker Runtime HTTP2", + "arnNamespace": "sagemaker", + "cloudFormationName": "SageMakerRuntime", + "endpointPrefix": "runtime.sagemaker", + } + ), + ), + Trait.new( + id=ShapeID("aws.endpoints#standardRegionalEndpoints"), + value=MappingProxyType( + { + "partitionSpecialCases": MappingProxyType( + { + "aws": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-cn": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-us-gov": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-iso": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-iso-b": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-iso-f": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + "aws-eusc": ( + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dnsSuffix}:8443", + "fips": False, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://{service}.{region}.{dualStackDnsSuffix}:8443", + "fips": False, + "dualStack": True, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dnsSuffix}:8443", + "fips": True, + "dualStack": False, + } + ), + MappingProxyType( + { + "endpoint": "https://runtime-fips.sagemaker.{region}.{dualStackDnsSuffix}:8443", + "fips": True, + "dualStack": True, + } + ), + ), + } + ) + } + ), + ), + Trait.new( + id=ShapeID("aws.protocols#restJson1"), + value=MappingProxyType({"http": ("h2",), "eventStreamHttp": ("h2",)}), + ), ], - ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py index 34859ce..fcc4043 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/auth.py @@ -8,7 +8,9 @@ class HTTPAuthSchemeResolver: - def resolve_auth_scheme(self, auth_parameters: AuthParams[Any, Any]) -> list[AuthOptionProtocol]: + def resolve_auth_scheme( + self, auth_parameters: AuthParams[Any, Any] + ) -> list[AuthOptionProtocol]: auth_options: list[AuthOptionProtocol] = [] if (option := _generate_sigv4_option(auth_parameters)) is not None: @@ -16,9 +18,12 @@ def resolve_auth_scheme(self, auth_parameters: AuthParams[Any, Any]) -> list[Aut return auth_options -def _generate_sigv4_option(auth_params: AuthParams[Any, Any]) -> AuthOptionProtocol | None: + +def _generate_sigv4_option( + auth_params: AuthParams[Any, Any], +) -> AuthOptionProtocol | None: return AuthOption( scheme_id=ShapeID("aws.auth#sigv4"), identity_properties={}, # type: ignore - signer_properties={} # type: ignore + signer_properties={}, # type: ignore ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py index 0acd130..2829a88 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py @@ -24,9 +24,9 @@ from .user_agent import aws_user_agent_plugin - logger = logging.getLogger(__name__) + class SageMakerRuntimeHTTP2Client: """ The Amazon SageMaker AI runtime HTTP/2 API. @@ -37,13 +37,13 @@ class SageMakerRuntimeHTTP2Client: :param plugins: A list of callables that modify the configuration dynamically. These can be used to set defaults, for example. """ - def __init__(self, config: Config | None = None, plugins: list[Plugin] | None = None): + + def __init__( + self, config: Config | None = None, plugins: list[Plugin] | None = None + ): self._config = config or Config() - client_plugins: list[Plugin] = [ - aws_user_agent_plugin, - user_agent_plugin, - ] + client_plugins: list[Plugin] = [aws_user_agent_plugin, user_agent_plugin] if plugins: client_plugins.extend(plugins) @@ -55,8 +55,12 @@ def __init__(self, config: Config | None = None, plugins: list[Plugin] | None = async def invoke_endpoint_with_bidirectional_stream( self, input: InvokeEndpointWithBidirectionalStreamInput, - plugins: list[Plugin] | None = None - ) -> DuplexEventStream[RequestStreamEvent, ResponseStreamEvent, InvokeEndpointWithBidirectionalStreamOutput]: + plugins: list[Plugin] | None = None, + ) -> DuplexEventStream[ + RequestStreamEvent, + ResponseStreamEvent, + InvokeEndpointWithBidirectionalStreamOutput, + ]: """ Invokes a model endpoint with bidirectional streaming capabilities. This operation establishes a persistent connection that allows you to send multiple @@ -93,16 +97,16 @@ async def invoke_endpoint_with_bidirectional_stream( Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. """ - operation_plugins: list[Plugin] = [ - - ] + operation_plugins: list[Plugin] = [] if plugins: operation_plugins.extend(plugins) config = deepcopy(self._config) for plugin in operation_plugins: plugin(config) if config.protocol is None or config.transport is None: - raise ExpectationNotMetError("protocol and transport MUST be set on the config to make calls.") + raise ExpectationNotMetError( + "protocol and transport MUST be set on the config to make calls." + ) # Resolve retry strategy from config if isinstance(config.retry_strategy, RetryStrategy): @@ -121,10 +125,7 @@ async def invoke_endpoint_with_bidirectional_stream( f"got {type(config.retry_strategy).__name__}" ) - pipeline = RequestPipeline( - protocol=config.protocol, - transport=config.transport - ) + pipeline = RequestPipeline(protocol=config.protocol, transport=config.transport) call = ClientCall( input=input, operation=INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, @@ -140,5 +141,5 @@ async def invoke_endpoint_with_bidirectional_stream( call, RequestStreamEvent, ResponseStreamEvent, - _ResponseStreamEventDeserializer().deserialize + _ResponseStreamEventDeserializer().deserialize, ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py index ea3e06a..81a3692 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py @@ -9,7 +9,6 @@ StandardRegionalEndpointsResolver as _RegionalResolver, ) from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.endpoints import StaticEndpointResolver from smithy_core.aio.interfaces import ( ClientProtocol, ClientTransport, @@ -35,7 +34,16 @@ ) -_ServiceInterceptor = Union[Interceptor[InvokeEndpointWithBidirectionalStreamInput, InvokeEndpointWithBidirectionalStreamOutput, Any, Any]] +_ServiceInterceptor = Union[ + Interceptor[ + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, + Any, + Any, + ] +] + + @dataclass(init=False) class Config: """Configuration for SageMaker Runtime HTTP2.""" @@ -43,7 +51,9 @@ class Config: auth_scheme_resolver: HTTPAuthSchemeResolver auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] aws_access_key_id: str | None - aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + aws_credentials_identity_resolver: ( + IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + ) aws_secret_access_key: str | None aws_session_token: str | None endpoint_resolver: _EndpointResolver @@ -63,7 +73,10 @@ def __init__( auth_scheme_resolver: HTTPAuthSchemeResolver | None = None, auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None, aws_access_key_id: str | None = None, - aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = None, + aws_credentials_identity_resolver: IdentityResolver[ + AWSCredentialsIdentity, AWSIdentityProperties + ] + | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, endpoint_resolver: _EndpointResolver | None = None, @@ -134,17 +147,21 @@ def __init__( """ self.auth_scheme_resolver = auth_scheme_resolver or HTTPAuthSchemeResolver() self.auth_schemes = auth_schemes or { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sagemaker"), + ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sagemaker") } self.aws_access_key_id = aws_access_key_id self.aws_credentials_identity_resolver = aws_credentials_identity_resolver self.aws_secret_access_key = aws_secret_access_key self.aws_session_token = aws_session_token - self.endpoint_resolver = endpoint_resolver or _RegionalResolver(endpoint_prefix="runtime.sagemaker") + self.endpoint_resolver = endpoint_resolver or _RegionalResolver( + endpoint_prefix="runtime.sagemaker" + ) self.endpoint_uri = endpoint_uri self.http_request_config = http_request_config self.interceptors = interceptors or [] - self.protocol = protocol or RestJsonClientProtocol(_SCHEMA_AMAZON_SAGE_MAKER_RUNTIME_HTTP2) + self.protocol = protocol or RestJsonClientProtocol( + _SCHEMA_AMAZON_SAGE_MAKER_RUNTIME_HTTP2 + ) self.region = region self.retry_strategy = retry_strategy self.sdk_ua_app_id = sdk_ua_app_id @@ -160,6 +177,7 @@ def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: """ self.auth_schemes[scheme.scheme_id] = scheme + # # A callable that allows customizing the config object on each request. # diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py index 47da969..02539c6 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py @@ -2,7 +2,7 @@ from dataclasses import dataclass, field import logging -from typing import Any, ClassVar, Literal, Self, Union +from typing import Any, Literal, Self, Union from smithy_core.deserializers import ShapeDeserializer from smithy_core.documents import TypeRegistry @@ -28,9 +28,9 @@ ) - logger = logging.getLogger(__name__) + class ServiceError(ModeledError): """Base error for all errors in the service. @@ -38,6 +38,7 @@ class ServiceError(ModeledError): synthetic, implicit, and shared exception types. """ + @dataclass(kw_only=True) class InputValidationError(ServiceError): """ @@ -56,10 +57,14 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["Message"], self.message) + serializer.write_string( + _SCHEMA_INPUT_VALIDATION_ERROR.members["Message"], self.message + ) if self.error_code is not None: - serializer.write_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"], self.error_code) + serializer.write_string( + _SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"], self.error_code + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -72,10 +77,14 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_INPUT_VALIDATION_ERROR.members["Message"] + ) case 1: - kwargs["error_code"] = de.read_string(_SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"]) + kwargs["error_code"] = de.read_string( + _SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -83,6 +92,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_INPUT_VALIDATION_ERROR, consumer=_consumer) return kwargs + @dataclass(kw_only=True) class InternalServerError(ServiceError): """ @@ -102,10 +112,14 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["Message"], self.message) + serializer.write_string( + _SCHEMA_INTERNAL_SERVER_ERROR.members["Message"], self.message + ) if self.error_code is not None: - serializer.write_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"], self.error_code) + serializer.write_string( + _SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"], self.error_code + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -118,10 +132,14 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_INTERNAL_SERVER_ERROR.members["Message"] + ) case 1: - kwargs["error_code"] = de.read_string(_SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"]) + kwargs["error_code"] = de.read_string( + _SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -129,6 +147,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_ERROR, consumer=_consumer) return kwargs + @dataclass(kw_only=True) class InternalStreamFailure(ServiceError): """ @@ -142,7 +161,9 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"], self.message) + serializer.write_string( + _SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"], self.message + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -155,7 +176,9 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -163,6 +186,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_INTERNAL_STREAM_FAILURE, consumer=_consumer) return kwargs + @dataclass(kw_only=True) class RequestPayloadPart: """ @@ -195,13 +219,20 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.bytes_ is not None: - serializer.write_blob(_SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"], self.bytes_) + serializer.write_blob( + _SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"], self.bytes_ + ) if self.data_type is not None: - serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"], self.data_type) + serializer.write_string( + _SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"], self.data_type + ) if self.completion_state is not None: - serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"], self.completion_state) + serializer.write_string( + _SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"], + self.completion_state, + ) if self.p is not None: serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["P"], self.p) @@ -217,16 +248,24 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["bytes_"] = de.read_blob(_SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"]) + kwargs["bytes_"] = de.read_blob( + _SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"] + ) case 1: - kwargs["data_type"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"]) + kwargs["data_type"] = de.read_string( + _SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"] + ) case 2: - kwargs["completion_state"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"]) + kwargs["completion_state"] = de.read_string( + _SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"] + ) case 3: - kwargs["p"] = de.read_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["P"]) + kwargs["p"] = de.read_string( + _SCHEMA_REQUEST_PAYLOAD_PART.members["P"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -234,6 +273,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_REQUEST_PAYLOAD_PART, consumer=_consumer) return kwargs + @dataclass class RequestStreamEventPayloadPart: """ @@ -246,12 +286,15 @@ def serialize(self, serializer: ShapeSerializer): serializer.write_struct(_SCHEMA_REQUEST_STREAM_EVENT, self) def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_STREAM_EVENT.members["PayloadPart"], self.value) + serializer.write_struct( + _SCHEMA_REQUEST_STREAM_EVENT.members["PayloadPart"], self.value + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: return cls(value=RequestPayloadPart.deserialize(deserializer)) + @dataclass class RequestStreamEventUnknown: """Represents an unknown variant. @@ -274,11 +317,14 @@ def serialize_members(self, serializer: ShapeSerializer): def deserialize(cls, deserializer: ShapeDeserializer) -> Self: raise NotImplementedError() + RequestStreamEvent = Union[RequestStreamEventPayloadPart | RequestStreamEventUnknown] """ Request stream event union. """ + + class _RequestStreamEventDeserializer: _result: RequestStreamEvent | None = None @@ -287,7 +333,9 @@ def deserialize(self, deserializer: ShapeDeserializer) -> RequestStreamEvent: deserializer.read_struct(_SCHEMA_REQUEST_STREAM_EVENT, self._consumer) if self._result is None: - raise SerializationError("Unions must have exactly one value, but found none.") + raise SerializationError( + "Unions must have exactly one value, but found none." + ) return self._result @@ -301,12 +349,14 @@ def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: def _set_result(self, value: RequestStreamEvent) -> None: if self._result is not None: - raise SerializationError("Unions must have exactly one value, but found more than one.") + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) self._result = value + @dataclass(kw_only=True) class InvokeEndpointWithBidirectionalStreamInput: - endpoint_name: str | None = None """ The name of the endpoint to invoke. @@ -328,20 +378,42 @@ class InvokeEndpointWithBidirectionalStreamInput: """ def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, self) + serializer.write_struct( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, self + ) def serialize_members(self, serializer: ShapeSerializer): if self.endpoint_name is not None: - serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["EndpointName"], self.endpoint_name) + serializer.write_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "EndpointName" + ], + self.endpoint_name, + ) if self.target_variant is not None: - serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["TargetVariant"], self.target_variant) + serializer.write_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "TargetVariant" + ], + self.target_variant, + ) if self.model_invocation_path is not None: - serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelInvocationPath"], self.model_invocation_path) + serializer.write_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "ModelInvocationPath" + ], + self.model_invocation_path, + ) if self.model_query_string is not None: - serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelQueryString"], self.model_query_string) + serializer.write_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "ModelQueryString" + ], + self.model_query_string, + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -354,23 +426,42 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["endpoint_name"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["EndpointName"]) + kwargs["endpoint_name"] = de.read_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "EndpointName" + ] + ) case 2: - kwargs["target_variant"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["TargetVariant"]) + kwargs["target_variant"] = de.read_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "TargetVariant" + ] + ) case 3: - kwargs["model_invocation_path"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelInvocationPath"]) + kwargs["model_invocation_path"] = de.read_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "ModelInvocationPath" + ] + ) case 4: - kwargs["model_query_string"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members["ModelQueryString"]) + kwargs["model_query_string"] = de.read_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ + "ModelQueryString" + ] + ) case _: logger.debug("Unexpected member schema: %s", schema) - deserializer.read_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, consumer=_consumer) + deserializer.read_struct( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, consumer=_consumer + ) return kwargs + @dataclass(kw_only=True) class ModelStreamError(ServiceError): """ @@ -389,10 +480,14 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_MODEL_STREAM_ERROR.members["Message"], self.message) + serializer.write_string( + _SCHEMA_MODEL_STREAM_ERROR.members["Message"], self.message + ) if self.error_code is not None: - serializer.write_string(_SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"], self.error_code) + serializer.write_string( + _SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"], self.error_code + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -405,10 +500,14 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_MODEL_STREAM_ERROR.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_MODEL_STREAM_ERROR.members["Message"] + ) case 1: - kwargs["error_code"] = de.read_string(_SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"]) + kwargs["error_code"] = de.read_string( + _SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -416,6 +515,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_MODEL_STREAM_ERROR, consumer=_consumer) return kwargs + @dataclass(kw_only=True) class ResponsePayloadPart: """ @@ -448,13 +548,20 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.bytes_ is not None: - serializer.write_blob(_SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"], self.bytes_) + serializer.write_blob( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"], self.bytes_ + ) if self.data_type is not None: - serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"], self.data_type) + serializer.write_string( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"], self.data_type + ) if self.completion_state is not None: - serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"], self.completion_state) + serializer.write_string( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"], + self.completion_state, + ) if self.p is not None: serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["P"], self.p) @@ -470,16 +577,24 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["bytes_"] = de.read_blob(_SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"]) + kwargs["bytes_"] = de.read_blob( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"] + ) case 1: - kwargs["data_type"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"]) + kwargs["data_type"] = de.read_string( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"] + ) case 2: - kwargs["completion_state"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"]) + kwargs["completion_state"] = de.read_string( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"] + ) case 3: - kwargs["p"] = de.read_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["P"]) + kwargs["p"] = de.read_string( + _SCHEMA_RESPONSE_PAYLOAD_PART.members["P"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -487,6 +602,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_RESPONSE_PAYLOAD_PART, consumer=_consumer) return kwargs + @dataclass class ResponseStreamEventPayloadPart: """ @@ -499,12 +615,15 @@ def serialize(self, serializer: ShapeSerializer): serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["PayloadPart"], self.value) + serializer.write_struct( + _SCHEMA_RESPONSE_STREAM_EVENT.members["PayloadPart"], self.value + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: return cls(value=ResponsePayloadPart.deserialize(deserializer)) + @dataclass class ResponseStreamEventModelStreamError: """ @@ -517,12 +636,15 @@ def serialize(self, serializer: ShapeSerializer): serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["ModelStreamError"], self.value) + serializer.write_struct( + _SCHEMA_RESPONSE_STREAM_EVENT.members["ModelStreamError"], self.value + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: return cls(value=ModelStreamError.deserialize(deserializer)) + @dataclass class ResponseStreamEventInternalStreamFailure: """ @@ -535,12 +657,15 @@ def serialize(self, serializer: ShapeSerializer): serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT.members["InternalStreamFailure"], self.value) + serializer.write_struct( + _SCHEMA_RESPONSE_STREAM_EVENT.members["InternalStreamFailure"], self.value + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: return cls(value=InternalStreamFailure.deserialize(deserializer)) + @dataclass class ResponseStreamEventUnknown: """Represents an unknown variant. @@ -563,11 +688,19 @@ def serialize_members(self, serializer: ShapeSerializer): def deserialize(cls, deserializer: ShapeDeserializer) -> Self: raise NotImplementedError() -ResponseStreamEvent = Union[ResponseStreamEventPayloadPart | ResponseStreamEventModelStreamError | ResponseStreamEventInternalStreamFailure | ResponseStreamEventUnknown] + +ResponseStreamEvent = Union[ + ResponseStreamEventPayloadPart + | ResponseStreamEventModelStreamError + | ResponseStreamEventInternalStreamFailure + | ResponseStreamEventUnknown +] """ Response stream event union. """ + + class _ResponseStreamEventDeserializer: _result: ResponseStreamEvent | None = None @@ -576,7 +709,9 @@ def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStreamEvent: deserializer.read_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self._consumer) if self._result is None: - raise SerializationError("Unions must have exactly one value, but found none.") + raise SerializationError( + "Unions must have exactly one value, but found none." + ) return self._result @@ -589,30 +724,41 @@ def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: self._set_result(ResponseStreamEventModelStreamError.deserialize(de)) case 2: - self._set_result(ResponseStreamEventInternalStreamFailure.deserialize(de)) + self._set_result( + ResponseStreamEventInternalStreamFailure.deserialize(de) + ) case _: logger.debug("Unexpected member schema: %s", schema) def _set_result(self, value: ResponseStreamEvent) -> None: if self._result is not None: - raise SerializationError("Unions must have exactly one value, but found more than one.") + raise SerializationError( + "Unions must have exactly one value, but found more than one." + ) self._result = value + @dataclass(kw_only=True) class InvokeEndpointWithBidirectionalStreamOutput: - invoked_production_variant: str | None = None """ The invoked production variant. """ def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self) + serializer.write_struct( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self + ) def serialize_members(self, serializer: ShapeSerializer): if self.invoked_production_variant is not None: - serializer.write_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members["InvokedProductionVariant"], self.invoked_production_variant) + serializer.write_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ + "InvokedProductionVariant" + ], + self.invoked_production_variant, + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -625,14 +771,21 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 1: - kwargs["invoked_production_variant"] = de.read_string(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members["InvokedProductionVariant"]) + kwargs["invoked_production_variant"] = de.read_string( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ + "InvokedProductionVariant" + ] + ) case _: logger.debug("Unexpected member schema: %s", schema) - deserializer.read_struct(_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, consumer=_consumer) + deserializer.read_struct( + _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, consumer=_consumer + ) return kwargs + @dataclass(kw_only=True) class ModelError(ServiceError): """ @@ -666,19 +819,30 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_MODEL_ERROR.members["Message"], self.message) + serializer.write_string( + _SCHEMA_MODEL_ERROR.members["Message"], self.message + ) if self.original_status_code is not None: - serializer.write_integer(_SCHEMA_MODEL_ERROR.members["OriginalStatusCode"], self.original_status_code) + serializer.write_integer( + _SCHEMA_MODEL_ERROR.members["OriginalStatusCode"], + self.original_status_code, + ) if self.original_message is not None: - serializer.write_string(_SCHEMA_MODEL_ERROR.members["OriginalMessage"], self.original_message) + serializer.write_string( + _SCHEMA_MODEL_ERROR.members["OriginalMessage"], self.original_message + ) if self.log_stream_arn is not None: - serializer.write_string(_SCHEMA_MODEL_ERROR.members["LogStreamArn"], self.log_stream_arn) + serializer.write_string( + _SCHEMA_MODEL_ERROR.members["LogStreamArn"], self.log_stream_arn + ) if self.error_code is not None: - serializer.write_string(_SCHEMA_MODEL_ERROR.members["ErrorCode"], self.error_code) + serializer.write_string( + _SCHEMA_MODEL_ERROR.members["ErrorCode"], self.error_code + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -691,19 +855,29 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_MODEL_ERROR.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_MODEL_ERROR.members["Message"] + ) case 1: - kwargs["original_status_code"] = de.read_integer(_SCHEMA_MODEL_ERROR.members["OriginalStatusCode"]) + kwargs["original_status_code"] = de.read_integer( + _SCHEMA_MODEL_ERROR.members["OriginalStatusCode"] + ) case 2: - kwargs["original_message"] = de.read_string(_SCHEMA_MODEL_ERROR.members["OriginalMessage"]) + kwargs["original_message"] = de.read_string( + _SCHEMA_MODEL_ERROR.members["OriginalMessage"] + ) case 3: - kwargs["log_stream_arn"] = de.read_string(_SCHEMA_MODEL_ERROR.members["LogStreamArn"]) + kwargs["log_stream_arn"] = de.read_string( + _SCHEMA_MODEL_ERROR.members["LogStreamArn"] + ) case 4: - kwargs["error_code"] = de.read_string(_SCHEMA_MODEL_ERROR.members["ErrorCode"]) + kwargs["error_code"] = de.read_string( + _SCHEMA_MODEL_ERROR.members["ErrorCode"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -711,6 +885,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_MODEL_ERROR, consumer=_consumer) return kwargs + @dataclass(kw_only=True) class ServiceUnavailableError(ServiceError): """ @@ -729,10 +904,14 @@ def serialize(self, serializer: ShapeSerializer): def serialize_members(self, serializer: ShapeSerializer): if self.message is not None: - serializer.write_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"], self.message) + serializer.write_string( + _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"], self.message + ) if self.error_code is not None: - serializer.write_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"], self.error_code) + serializer.write_string( + _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"], self.error_code + ) @classmethod def deserialize(cls, deserializer: ShapeDeserializer) -> Self: @@ -745,10 +924,14 @@ def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: def _consumer(schema: Schema, de: ShapeDeserializer) -> None: match schema.expect_member_index(): case 0: - kwargs["message"] = de.read_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"]) + kwargs["message"] = de.read_string( + _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"] + ) case 1: - kwargs["error_code"] = de.read_string(_SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"]) + kwargs["error_code"] = de.read_string( + _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"] + ) case _: logger.debug("Unexpected member schema: %s", schema) @@ -756,21 +939,32 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: deserializer.read_struct(_SCHEMA_SERVICE_UNAVAILABLE_ERROR, consumer=_consumer) return kwargs + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = APIOperation( - input = InvokeEndpointWithBidirectionalStreamInput, - output = InvokeEndpointWithBidirectionalStreamOutput, - schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, - input_schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, - output_schema = _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, - error_registry = TypeRegistry({ - ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"): InputValidationError, -ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"): InternalServerError, -ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"): InternalStreamFailure, -ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"): ModelError, -ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"): ModelStreamError, -ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"): ServiceUnavailableError, - }), - effective_auth_schemes = [ - ShapeID("aws.auth#sigv4"), - ] + input=InvokeEndpointWithBidirectionalStreamInput, + output=InvokeEndpointWithBidirectionalStreamOutput, + schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + input_schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, + output_schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, + error_registry=TypeRegistry( + { + ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InputValidationError" + ): InputValidationError, + ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InternalServerError" + ): InternalServerError, + ShapeID( + "com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure" + ): InternalStreamFailure, + ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"): ModelError, + ShapeID( + "com.amazonaws.sagemakerruntimehttp2#ModelStreamError" + ): ModelStreamError, + ShapeID( + "com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError" + ): ServiceUnavailableError, + } + ), + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py b/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py index 6cc3a18..f8f66e0 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/tests/test_protocol.py @@ -15,6 +15,7 @@ class TestHttpServiceError(ServiceError): def __init__(self, request: HTTPRequest): self.request = request + class RequestTestHTTPClient: """An asynchronous HTTP client solely for testing purposes.""" @@ -24,11 +25,15 @@ def __init__(self, *, client_config: HTTPClientConfiguration | None = None): self._client_config = client_config async def send( - self, request: HTTPRequest, *, request_config: HTTPRequestConfiguration | None = None + self, + request: HTTPRequest, + *, + request_config: HTTPRequestConfiguration | None = None, ) -> HTTPResponse: # Raise the exception with the request object to bypass actual request handling raise TestHttpServiceError(request) + class ResponseTestHTTPClient: """An asynchronous HTTP client solely for testing purposes.""" @@ -48,11 +53,12 @@ def __init__( self.body = body async def send( - self, request: HTTPRequest, *, request_config: HTTPRequestConfiguration | None = None + self, + request: HTTPRequest, + *, + request_config: HTTPRequestConfiguration | None = None, ) -> _HTTPResponse: # Pre-construct the response from the request and return it return _HTTPResponse( - status=self.status, - fields=self.fields, - body=async_list([self.body]), + status=self.status, fields=self.fields, body=async_list([self.body]) )