From e7a6e2edb194b9f799d9c030aab23a695a4f4c8c Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 14:08:25 -0800 Subject: [PATCH 01/40] Workflow and makefile changes --- .github/actions/polymorph_codegen/action.yml | 116 ++++++ .github/workflows/ci_codegen.yml | 55 +++ .github/workflows/ci_test_java.yml | 9 + .github/workflows/ci_test_net.yml | 9 + .github/workflows/ci_verification.yml | 11 +- SharedMakefile.mk | 413 +------------------ submodules/smithy-dafny | 2 +- 7 files changed, 203 insertions(+), 412 deletions(-) create mode 100644 .github/actions/polymorph_codegen/action.yml create mode 100644 .github/workflows/ci_codegen.yml diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml new file mode 100644 index 000000000..fa68036b1 --- /dev/null +++ b/.github/actions/polymorph_codegen/action.yml @@ -0,0 +1,116 @@ +# +# This local action serves two purposes: +# +# 1. For core workflows like pull.yml and push.yml, +# it is uses to check that the checked in copy of generated code +# matches what the current submodule version of smithy-dafny generates. +# This is important to ensure whenever someone changes the models +# or needs to regenerate to pick up smithy-dafny improvements, +# they don't have to deal with unpleasant surprises. +# +# 2. For workflows that check compatibility with other Dafny versions, +# such as nightly_dafny.yml, it is necessary to regenerate the code +# for that version of Dafny first. +# This is ultimately because some of the code smithy-dafny generates +# is tightly coupled to what code Dafny itself generates. +# A concrete example is that Dafny 4.3 added TypeDescriptors +# as parameters when constructing datatypes like Option and Result. +# +# This is why this is a composite action instead of a reusable workflow: +# the latter executes in a separate runner environment, +# but here we need to actually overwrite the generated code in place +# so that subsequent steps can work correctly. +# +# This action assumes that the given version of Dafny and .NET 6.0.x +# have already been set up, since they are used to format generated code. +# +# Note that recursively generating code doesn't currently work in this repo +# with the version of the mpl pinned by the submodule, +# because the SharedMakefileV2.mk in it doesn't work with newer versions of smithy-dafny. +# Therefore by default we don't recursively regenerate code +# (accomplished by setting the POLYMORPH_DEPENDENCIES environment variable to ""). +# If `update-and-regenerate-mpl` is true, we first pull the latest mpl, +# which is necessary both for Makefile compatibility and so we can regenerate mpl code +# for compatibility with newer versions of Dafny. +# + +name: "Polymorph code generation" +description: "Regenerates code using smithy-dafny, and optionally checks that the result matches the checked in state" +inputs: + dafny: + description: "The Dafny version to run" + required: true + type: string + library: + description: "Name of the library to regenerate code for" + required: true + type: string + diff-generated-code: + description: "Diff regenerated code against committed state" + required: true + type: boolean + update-and-regenerate-mpl: + description: "Locally update MPL to the tip of master and regenerate its code too" + required: false + default: false + type: boolean +runs: + using: "composite" + steps: + - name: Update MPL submodule locally if requested + if: inputs.update-and-regenerate-mpl == 'true' + shell: bash + run: | + git submodule update --init --recursive --remote --merge mpl + + - name: Don't regenerate dependencies unless requested + id: dependencies + shell: bash + run: | + echo "PROJECT_DEPENDENCIES=${{ inputs.update-and-regenerate-mpl != 'true' && 'PROJECT_DEPENDENCIES=' || '' }}" >> $GITHUB_OUTPUT + + - name: Regenerate Dafny code using smithy-dafny + # Unfortunately Dafny codegen doesn't work on Windows: + # https://github.com/smithy-lang/smithy-dafny/issues/317 + if: runner.os != 'Windows' + working-directory: ./${{ inputs.library }} + shell: bash + run: | + make polymorph_dafny ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }} + + - name: Set up prettier in MPL + if: inputs.update-and-regenerate-mpl == 'true' + shell: bash + # Annoyingly, prettier has to be installed in each library individually. + # And this is only necessary or even possible if we've updated the mpl submodule. + run: | + make -C mpl/AwsCryptographyPrimitives setup_prettier + make -C mpl/AwsCryptographicMaterialProviders setup_prettier + make -C mpl/ComAmazonawsKms setup_prettier + make -C mpl/ComAmazonawsDynamodb setup_prettier + + - name: Regenerate Java code using smithy-dafny + # npx seems to be unavailable on Windows GHA runners, + # so we don't regenerate Java code on them either. + if: runner.os != 'Windows' + working-directory: ./${{ inputs.library }} + shell: bash + # smithy-dafny also formats generated code itself now, + # so prettier is a necessary dependency. + run: | + make setup_prettier + make polymorph_java ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }} + + - name: Regenerate .NET code using smithy-dafny + working-directory: ./${{ inputs.library }} + shell: bash + run: | + make polymorph_dotnet ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }} + + - name: Check regenerated code against commited code + # Composite action inputs seem to not actually support booleans properly for some reason + if: inputs.diff-generated-code == 'true' + working-directory: ./${{ inputs.library }} + shell: bash + run: | + make check_polymorph_diff diff --git a/.github/workflows/ci_codegen.yml b/.github/workflows/ci_codegen.yml new file mode 100644 index 000000000..85b41f934 --- /dev/null +++ b/.github/workflows/ci_codegen.yml @@ -0,0 +1,55 @@ +# This workflow regenerates code using smithy-dafny and checks that the output matches what's checked in. +name: Library Code Generation +on: + pull_request: + push: + branches: + - main + +jobs: + code-generation: + strategy: + fail-fast: false + matrix: + library: + [ + DynamoDbEncryption, + ] + # Note dotnet is only used for formatting generated code + # in this workflow + dotnet-version: ["6.0.x"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 + steps: + - name: Support longpaths + run: | + git config --global core.longpaths true + + - uses: actions/checkout@v3 + with: + submodules: recursive + + # Only used to format generated code + # and to translate version strings such as "nightly-latest" + # to an actual DAFNY_VERSION. + - name: Setup Dafny + uses: dafny-lang/setup-dafny-action@v1.7.0 + with: + dafny-version: 4.2.0 + + - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.library }} + diff-generated-code: true diff --git a/.github/workflows/ci_test_java.yml b/.github/workflows/ci_test_java.yml index 0746c6b86..202af284b 100644 --- a/.github/workflows/ci_test_java.yml +++ b/.github/workflows/ci_test_java.yml @@ -58,6 +58,15 @@ jobs: # A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports. dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} + - name: Regenerate code using smithy-dafny if necessary + if: ${{ inputs.nightly }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.library }} + diff-generated-code: false + update-and-regenerate-mpl: true + - name: Setup Java ${{ matrix.java-version }} uses: actions/setup-java@v4 with: diff --git a/.github/workflows/ci_test_net.yml b/.github/workflows/ci_test_net.yml index 6fbcb9701..0aed94cee 100644 --- a/.github/workflows/ci_test_net.yml +++ b/.github/workflows/ci_test_net.yml @@ -65,6 +65,15 @@ jobs: # A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports. dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} + - name: Regenerate code using smithy-dafny if necessary + if: ${{ inputs.nightly }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.library }} + diff-generated-code: false + update-and-regenerate-mpl: true + - name: Download Dependencies working-directory: ./${{ matrix.library }} run: make setup_net diff --git a/.github/workflows/ci_verification.yml b/.github/workflows/ci_verification.yml index c6617803c..407f8dd2c 100644 --- a/.github/workflows/ci_verification.yml +++ b/.github/workflows/ci_verification.yml @@ -51,8 +51,17 @@ jobs: with: # A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports. dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }} + + - name: Regenerate code using smithy-dafny if necessary + if: ${{ inputs.nightly }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.service }} + diff-generated-code: false + update-and-regenerate-mpl: true - - name: Verify ${{ matrix.library }} Dafny code + - name: Verify ${{ matrix.service }} Dafny code shell: bash working-directory: ./DynamoDbEncryption run: | diff --git a/SharedMakefile.mk b/SharedMakefile.mk index 43c0425a0..21e4627a7 100644 --- a/SharedMakefile.mk +++ b/SharedMakefile.mk @@ -1,419 +1,12 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -# These make targets that are shared -# between all the projects in this repo. -# They will only function if executed inside a project directory. - -# There are several variables that are used here. -# The expectation is to define these variables -# inside each project. - -# Variables: -# MAX_RESOURCE_COUNT -- The Dafny report generator max resource count. -# This is is per project because the verification variability can differ. -# PROJECT_DEPENDENCIES -- List of dependencies for the project. -# It should be the list of top level directory names -# PROJECT_SERVICES -- List of names of each local service in the project -# SERVICE_NAMESPACE_ -- for each service in PROJECT_SERVICES, -# the list of dependencies for that smithy namespace. It should be a list -# of Model directories -# SERVICE_DEPS_ -- for each service in PROJECT_SERVICES, -# the list of dependencies for that smithy namespace. It should be a list -# of Model directories -# AWS_SDK_CMD -- the `--aws-sdk` command to generate AWS SDK style interfaces. -# STD_LIBRARY -- path from this file to the StandardLibrary Dafny project. -# SMITHY_DEPS -- path from this file to smithy dependencies, such as custom traits. - # This evaluates to the local path _of this file_. # This means that these are the project roots # that are shared by all libraries in this repo. PROJECT_ROOT := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))) -# This evaluates to the path of the current working directory. -# i.e. The specific library under consideration. -LIBRARY_ROOT := $(PWD) -# Smithy Dafny code gen needs to know -# where the smithy model is. -# This is generally in the same directory as the library. -# However in the case of a wrapped library, -# such as the test vectors -# the implementation MAY be in a different library -# than the model. -# By having two related variables -# test vector projects can point to -# the specific model they need -# but still build everything in their local library directory. -SMITHY_MODEL_ROOT := $(LIBRARY_ROOT)/Model - -# Later versions of Dafny no longer default to adding "_Compile" -# to the names of modules when translating. -# Our target language code still assumes it does, -# so IF the /compileSuffix option is available in our verion of Dafny -# we need to provide it. -COMPILE_SUFFIX_OPTION := -compileSuffix:1 - -########################## Dafny targets - -# Verify the entire project -verify: - dafny \ - -vcsCores:$(CORES) \ - -compile:0 \ - -definiteAssignment:3 \ - -quantifierSyntax:3 \ - -unicodeChar:0 \ - -functionSyntax:3 \ - -verificationLogger:csv \ - -timeLimit:100 \ - -trace \ - `find . -name *.dfy` - -# Verify single file FILE with text logger. -# This is useful for debugging resource count usage within a file. -# Use PROC to further scope the verification -verify_single: - @: $(if ${CORES},,CORES=2); - dafny \ - -vcsCores:$(CORES) \ - -compile:0 \ - -definiteAssignment:3 \ - -quantifierSyntax:3 \ - -unicodeChar:0 \ - -functionSyntax:3 \ - -verificationLogger:text \ - -timeLimit:100 \ - -trace \ - $(if ${PROC},-proc:*$(PROC)*,) \ - $(FILE) - -#Verify only a specific namespace at env var $(SERVICE) -verify_service: - @: $(if ${SERVICE},,$(error You must pass the SERVICE to generate for)); - dafny \ - -vcsCores:$(CORES) \ - -compile:0 \ - -definiteAssignment:3 \ - -quantifierSyntax:3 \ - -unicodeChar:0 \ - -functionSyntax:3 \ - -verificationLogger:csv \ - -timeLimit:100 \ - -trace \ - `find ./dafny/$(SERVICE) -name '*.dfy'` \ - -format: - dafny format \ - --function-syntax 3 \ - --quantifier-syntax 3 \ - --unicode-char false \ - `find . -name '*.dfy'` - -format-check: - dafny format \ - --check \ - --function-syntax 3 \ - --quantifier-syntax 3 \ - --unicode-char false \ - `find . -name '*.dfy'` - -dafny-reportgenerator: - dafny-reportgenerator \ - summarize-csv-results \ - --max-resource-count $(MAX_RESOURCE_COUNT) \ - TestResults/*.csv - -# Dafny helper targets - -# Transpile the entire project's impl -_transpile_implementation_all: TRANSPILE_TARGETS=$(if ${DIR_STRUCTURE_V2}, $(patsubst %, ./dafny/%/src/Index.dfy, $(PROJECT_SERVICES)), src/Index.dfy) -_transpile_implementation_all: TRANSPILE_DEPENDENCIES=$(patsubst %, -library:$(PROJECT_ROOT)/%, $(PROJECT_INDEX)) -_transpile_implementation_all: transpile_implementation - -# The `$(OUT)` and $(TARGET) variables are problematic. -# Ideally they are different for every target call. -# However the way make evaluates variables -# having a target specific variable is hard. -# This all comes up because a project -# will need to also transpile its dependencies. -# This is worked around for now, -# by the fact that the `TARGET` -# for all these transpile calls will be the same. -# For `OUT` this is solved by making the paths relative. -# So that the runtime is express once -# and can be the same for all such runtimes. -# Since such targets are all shared, -# this is tractable. - -# At this time is is *significatly* faster -# to give Dafny a single file -# that includes everything -# than it is to pass each file to the CLI. -# ~2m vs ~10s for our large projects. -# Also the expectation is that verification happens in the `verify` target -transpile_implementation: - find ./dafny/**/src ./src -name 'Index.dfy' | sed -e 's/^/include "/' -e 's/$$/"/' | dafny \ - -stdin \ - -noVerify \ - -vcsCores:$(CORES) \ - -compileTarget:$(TARGET) \ - -spillTargetCode:3 \ - -compile:0 \ - -optimizeErasableDatatypeWrapper:0 \ - $(COMPILE_SUFFIX_OPTION) \ - -quantifierSyntax:3 \ - -unicodeChar:0 \ - -functionSyntax:3 \ - -useRuntimeLib \ - -out $(OUT) \ - $(if $(strip $(STD_LIBRARY)) , -library:$(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy, ) \ - $(TRANSPILE_DEPENDENCIES) - -# Transpile the entire project's tests -_transpile_test_all: TRANSPILE_DEPENDENCIES=$(if ${DIR_STRUCTURE_V2}, $(patsubst %, -library:dafny/%/src/Index.dfy, $(PROJECT_SERVICES)), -library:src/Index.dfy) -_transpile_test_all: transpile_test - -transpile_test: - find ./dafny/**/test ./test -name "*.dfy" -name '*.dfy' | sed -e 's/^/include "/' -e 's/$$/"/' | dafny \ - -stdin \ - -noVerify \ - -vcsCores:$(CORES) \ - -compileTarget:$(TARGET) \ - -spillTargetCode:3 \ - -runAllTests:1 \ - -compile:0 \ - -optimizeErasableDatatypeWrapper:0 \ - $(COMPILE_SUFFIX_OPTION) \ - -quantifierSyntax:3 \ - -unicodeChar:0 \ - -functionSyntax:3 \ - -useRuntimeLib \ - -out $(OUT) \ - $(if $(strip $(STD_LIBRARY)) , -library:$(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy, ) \ - $(TRANSPILE_DEPENDENCIES) - - -# If we are not the StandardLibrary, transpile the StandardLibrary. -# Transpile all other dependencies -transpile_dependencies: - $(if $(strip $(STD_LIBRARY)), $(MAKE) -C $(PROJECT_ROOT)/$(STD_LIBRARY) transpile_implementation_$(LANG), ) - $(patsubst %, $(MAKE) -C $(PROJECT_ROOT)/% transpile_implementation_$(LANG);, $(PROJECT_DEPENDENCIES)) - -########################## Code-Gen targets - -# StandardLibrary is filtered out from dependent-model patsubst list; -# Its model is contained in $(LIBRARY_ROOT)/model, not $(LIBRARY_ROOT)/../StandardLibrary/Model. - -# The OUTPUT variables are created this way -# so that it is possible to run _parts_ of polymorph. -# Otherwise it is difficult to run/test only a Dafny change. -# Since they are defined per target -# a single target can decide what parts it wants to build. - -_polymorph: - @: $(if ${CODEGEN_CLI_ROOT},,$(error You must pass the path CODEGEN_CLI_ROOT: CODEGEN_CLI_ROOT=/[path]/[to]/smithy-dafny/codegen/smithy-dafny-codegen-cli)); - cd $(CODEGEN_CLI_ROOT); \ - ./../gradlew run --args="\ - $(OUTPUT_DAFNY) \ - $(OUTPUT_DOTNET) \ - $(OUTPUT_JAVA) \ - --model $(if $(DIR_STRUCTURE_V2), $(LIBRARY_ROOT)/dafny/$(SERVICE)/Model, $(SMITHY_MODEL_ROOT)) \ - --dependent-model $(PROJECT_ROOT)/$(SMITHY_DEPS) \ - $(patsubst %, --dependent-model $(PROJECT_ROOT)/%/Model, $($(service_deps_var))) \ - --namespace $($(namespace_var)) \ - $(AWS_SDK_CMD) \ - $(OUTPUT_LOCAL_SERVICE) \ - "; - -# Generates all target runtime code for all namespaces in this project. -.PHONY: polymorph_code_gen -polymorph_code_gen: - for service in $(PROJECT_SERVICES) ; do \ - export service_deps_var=SERVICE_DEPS_$${service} ; \ - export namespace_var=SERVICE_NAMESPACE_$${service} ; \ - export SERVICE=$${service} ; \ - $(MAKE) _polymorph_code_gen || exit 1; \ - done - -_polymorph_code_gen: OUTPUT_DAFNY=\ - --output-dafny $(if $(DIR_STRUCTURE_V2), $(LIBRARY_ROOT)/dafny/$(SERVICE)/Model, $(LIBRARY_ROOT)/Model) \ - --include-dafny $(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy -_polymorph_code_gen: OUTPUT_DOTNET=\ - $(if $(DIR_STRUCTURE_V2), --output-dotnet $(LIBRARY_ROOT)/runtimes/net/Generated/$(SERVICE)/, --output-dotnet $(LIBRARY_ROOT)/runtimes/net/Generated/) -_polymorph_code_gen: OUTPUT_JAVA=--output-java $(LIBRARY_ROOT)/runtimes/java/src/main/smithy-generated -_polymorph_code_gen: _polymorph - -# Generates dafny code for all namespaces in this project -.PHONY: polymorph_dafny -polymorph_dafny: - for service in $(PROJECT_SERVICES) ; do \ - export service_deps_var=SERVICE_DEPS_$${service} ; \ - export namespace_var=SERVICE_NAMESPACE_$${service} ; \ - export SERVICE=$${service} ; \ - $(MAKE) _polymorph_dafny || exit 1; \ - done - -_polymorph_dafny: OUTPUT_DAFNY=\ - --output-dafny $(if $(DIR_STRUCTURE_V2), $(LIBRARY_ROOT)/dafny/$(SERVICE)/Model, $(LIBRARY_ROOT)/Model) \ - --include-dafny $(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy -_polymorph_dafny: _polymorph - -# Generates dotnet code for all namespaces in this project -.PHONY: polymorph_dotnet -polymorph_dotnet: - for service in $(PROJECT_SERVICES) ; do \ - export service_deps_var=SERVICE_DEPS_$${service} ; \ - export namespace_var=SERVICE_NAMESPACE_$${service} ; \ - export SERVICE=$${service} ; \ - $(MAKE) _polymorph_dotnet || exit 1; \ - done - -_polymorph_dotnet: OUTPUT_DOTNET=\ - $(if $(DIR_STRUCTURE_V2), --output-dotnet $(LIBRARY_ROOT)/runtimes/net/Generated/$(SERVICE)/, --output-dotnet $(LIBRARY_ROOT)/runtimes/net/Generated/) -_polymorph_dotnet: _polymorph - -# Generates java code for all namespaces in this project -.PHONY: polymorph_java -polymorph_java: - for service in $(PROJECT_SERVICES) ; do \ - export service_deps_var=SERVICE_DEPS_$${service} ; \ - export namespace_var=SERVICE_NAMESPACE_$${service} ; \ - export SERVICE=$${service} ; \ - $(MAKE) _polymorph_java || exit 1; \ - done - -_polymorph_java: OUTPUT_JAVA=--output-java $(LIBRARY_ROOT)/runtimes/java/src/main/smithy-generated -_polymorph_java: _polymorph - -########################## .NET targets - -transpile_net: | transpile_implementation_net transpile_test_net transpile_dependencies_net - -transpile_implementation_net: TARGET=cs -transpile_implementation_net: OUT=runtimes/net/ImplementationFromDafny -transpile_implementation_net: _transpile_implementation_all - -transpile_test_net: TARGET=cs -transpile_test_net: OUT=runtimes/net/tests/TestsFromDafny -transpile_test_net: _transpile_test_all - -transpile_dependencies_net: LANG=net -transpile_dependencies_net: transpile_dependencies - -test_net: FRAMEWORK=net6.0 -test_net: - dotnet run \ - --project runtimes/net/tests/ \ - --framework $(FRAMEWORK) - -test_net_mac_intel: FRAMEWORK=net6.0 -test_net_mac_intel: - DYLD_LIBRARY_PATH="/usr/local/opt/openssl@1.1/lib" dotnet run \ - --project runtimes/net/tests/ \ - --framework $(FRAMEWORK) - -test_net_mac_brew: FRAMEWORK=net6.0 -test_net_mac_brew: - DYLD_LIBRARY_PATH="$(shell brew --prefix)/opt/openssl@1.1/lib/" dotnet run \ - --project runtimes/net/tests/ \ - --framework $(FRAMEWORK) - -setup_net: - dotnet restore runtimes/net/ - -########################## Java targets - -build_java: transpile_java mvn_local_deploy_dependencies - gradle -p runtimes/java build - -transpile_java: | transpile_implementation_java transpile_test_java transpile_dependencies_java - -transpile_implementation_java: TARGET=java -transpile_implementation_java: OUT=runtimes/java/ImplementationFromDafny -transpile_implementation_java: _transpile_implementation_all _mv_implementation_java - -transpile_test_java: TARGET=java -transpile_test_java: OUT=runtimes/java/TestsFromDafny -transpile_test_java: _transpile_test_all _mv_test_java - -# Currently Dafny compiles to Java by changing the directory name. -# Java puts things under a `java` directory. -# To avoid `java/implementation-java` the code is generated and then moved. -_mv_implementation_java: - rm -rf runtimes/java/src/main/dafny-generated - mv runtimes/java/ImplementationFromDafny-java runtimes/java/src/main/dafny-generated -_mv_test_java: - rm -rf runtimes/java/src/test/dafny-generated - mkdir -p runtimes/java/src/test - mv runtimes/java/TestsFromDafny-java runtimes/java/src/test/dafny-generated - -transpile_dependencies_java: LANG=java -transpile_dependencies_java: transpile_dependencies - -# If we are not StandardLibrary, locally deploy the StandardLibrary. -# Locally deploy all other dependencies -mvn_local_deploy_dependencies: - $(if $(strip $(STD_LIBRARY)), $(MAKE) -C $(PROJECT_ROOT)/$(STD_LIBRARY) mvn_local_deploy, ) - $(patsubst %, $(MAKE) -C $(PROJECT_ROOT)/% mvn_local_deploy;, $(PROJECT_DEPENDENCIES)) - -# The Java MUST all exist already through the transpile step. -mvn_local_deploy: - gradle -p runtimes/java publishMavenLocalPublicationToMavenLocal - -mvn_staging_deploy: - gradle -p runtimes/java publishMavenPublicationToStagingCodeArtifactRepository - -test_java: - # run Dafny generated tests - gradle -p runtimes/java runTests - -########################## local testing targets - -# These targets are added as a convenience for local development. -# If you experience weird behavior using these targets, -# fall back to the regular `build` or `test` targets. -# These targets MUST only be used for local testing, -# and MUST NOT be used in CI. - -# Targets to transpile single local service for convenience. -# Specify the local service to build by passing a SERVICE env var. -# Note that this does not generate identical files as `transpile_implementation_java` - -local_transpile_impl_java_single: TARGET=java -local_transpile_impl_java_single: OUT=runtimes/java/ImplementationFromDafny -local_transpile_impl_java_single: local_transpile_impl_single - cp -R runtimes/java/ImplementationFromDafny-java/* runtimes/java/src/main/dafny-generated - rm -rf runtimes/java/ImplementationFromDafny-java/ - -local_transpile_impl_net_single: TARGET=cs -local_transpile_impl_net_single: OUT=runtimes/net/ImplementationFromDafny -local_transpile_impl_net_single: local_transpile_impl_single - -local_transpile_impl_single: deps_var=SERVICE_DEPS_$(SERVICE) -local_transpile_impl_single: TRANSPILE_TARGETS=./dafny/$(SERVICE)/src/$(FILE) -local_transpile_impl_single: TRANSPILE_DEPENDENCIES= \ - $(patsubst %, -library:$(PROJECT_ROOT)/%/src/Index.dfy, $($(deps_var))) \ - $(patsubst %, -library:$(PROJECT_ROOT)/%, $(PROJECT_INDEX)) \ - -library:$(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy -local_transpile_impl_single: transpile_implementation - -# Targets to transpile single local service for convenience. -# Specify the local service to build by passing a SERVICE env var. -# Note that this does not generate identical files as `transpile_test_java`, -# and will clobber tests generated by other services. - -local_transpile_test_java_single: TARGET=java -local_transpile_test_java_single: OUT=runtimes/java/TestsFromDafny -local_transpile_test_java_single: local_transpile_test_single - cp -R runtimes/java/TestsFromDafny-java/* runtimes/java/src/test/dafny-generated - rm -rf runtimes/java/TestsFromDafny-java -local_transpile_test_net_single: TARGET=cs -local_transpile_test_net_single: OUT=runtimes/net/tests/TestsFromDafny -local_transpile_test_net_single: local_transpile_test_single +SMITHY_DAFNY_ROOT := $(PROJECT_ROOT)/submodules/smithy-dafny +GRADLEW := ./runtimes/java/gradlew -local_transpile_test_single: TRANSPILE_TARGETS=./dafny/$(SERVICE)/test/$(FILE) -local_transpile_test_single: TRANSPILE_DEPENDENCIES= \ - $(patsubst %, -library:dafny/%/src/Index.dfy, $(PROJECT_SERVICES)) \ - $(patsubst %, -library:$(PROJECT_ROOT)/%, $(PROJECT_INDEX)) \ - -library:$(PROJECT_ROOT)/$(STD_LIBRARY)/src/Index.dfy -local_transpile_test_single: transpile_test +include $(SMITHY_DAFNY_ROOT)/SmithyDafnyMakefile.mk diff --git a/submodules/smithy-dafny b/submodules/smithy-dafny index cf4522f80..16a8b6998 160000 --- a/submodules/smithy-dafny +++ b/submodules/smithy-dafny @@ -1 +1 @@ -Subproject commit cf4522f804542b51bffd1ec204c69aa0fb1ba7e2 +Subproject commit 16a8b699860edbffff3c3339dfccf046e3ccf213 From bca6327a354fbac1deff52c5404c4c459778e7b2 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 14:46:53 -0800 Subject: [PATCH 02/40] regenerate Dafny, fix client factory method return types --- ...yptographyDbEncryptionSdkDynamoDbTypes.dfy | 1055 ++--- .../dafny/DynamoDbEncryption/src/Index.dfy | 2 +- ...DbEncryptionSdkDynamoDbTransformsTypes.dfy | 3507 ++++++++--------- .../src/Index.dfy | 2 +- ...ncryptionSdkDynamoDbItemEncryptorTypes.dfy | 585 +-- .../dafny/DynamoDbItemEncryptor/src/Index.dfy | 2 +- ...EncryptionSdkStructuredEncryptionTypes.dfy | 653 +-- .../dafny/StructuredEncryption/src/Index.dfy | 2 +- 8 files changed, 2897 insertions(+), 2911 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy index 812d451fb..eda70a9d0 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy @@ -2,536 +2,543 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyKeyStoreTypes - import AwsCryptographyPrimitivesTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype AsSet = | AsSet ( - - ) - type AttributeActions = map - type BeaconBitLength = x: int32 | IsValid_BeaconBitLength(x) witness * - predicate method IsValid_BeaconBitLength(x: int32) { - ( 1 <= x <= 63 ) -} - datatype BeaconKeySource = - | single(single: SingleKeyStore) - | multi(multi: MultiKeyStore) - datatype BeaconStyle = - | partOnly(partOnly: PartOnly) - | shared(shared: Shared) - | asSet(asSet: AsSet) - | sharedSet(sharedSet: SharedSet) - datatype BeaconVersion = | BeaconVersion ( - nameonly version: VersionNumber , - nameonly keyStore: AwsCryptographyKeyStoreTypes.IKeyStoreClient , - nameonly keySource: BeaconKeySource , - nameonly standardBeacons: StandardBeaconList , - nameonly compoundBeacons: Option , - nameonly virtualFields: Option , - nameonly encryptedParts: Option , - nameonly signedParts: Option - ) - type BeaconVersionList = x: seq | IsValid_BeaconVersionList(x) witness * - predicate method IsValid_BeaconVersionList(x: seq) { - ( 1 <= |x| <= 1 ) -} - type Char = x: string | IsValid_Char(x) witness * - predicate method IsValid_Char(x: string) { - ( 1 <= |x| <= 1 ) -} - datatype CompoundBeacon = | CompoundBeacon ( - nameonly name: string , - nameonly split: Char , - nameonly encrypted: Option , - nameonly signed: Option , - nameonly constructors: Option - ) - type CompoundBeaconList = x: seq | IsValid_CompoundBeaconList(x) witness * - predicate method IsValid_CompoundBeaconList(x: seq) { - ( 1 <= |x| ) -} - datatype Constructor = | Constructor ( - nameonly parts: ConstructorPartList - ) - type ConstructorList = x: seq | IsValid_ConstructorList(x) witness * - predicate method IsValid_ConstructorList(x: seq) { - ( 1 <= |x| ) -} - datatype ConstructorPart = | ConstructorPart ( - nameonly name: string , - nameonly required: bool - ) - type ConstructorPartList = x: seq | IsValid_ConstructorPartList(x) witness * - predicate method IsValid_ConstructorPartList(x: seq) { - ( 1 <= |x| ) -} - datatype CreateDynamoDbEncryptionBranchKeyIdSupplierInput = | CreateDynamoDbEncryptionBranchKeyIdSupplierInput ( - nameonly ddbKeyBranchKeyIdSupplier: IDynamoDbKeyBranchKeyIdSupplier - ) - datatype CreateDynamoDbEncryptionBranchKeyIdSupplierOutput = | CreateDynamoDbEncryptionBranchKeyIdSupplierOutput ( - nameonly branchKeyIdSupplier: AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier - ) - class IDynamoDbEncryptionClientCallHistory { - ghost constructor() { - CreateDynamoDbEncryptionBranchKeyIdSupplier := []; -} - ghost var CreateDynamoDbEncryptionBranchKeyIdSupplier: seq>> -} - trait {:termination false} IDynamoDbEncryptionClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyKeyStoreTypes + import AwsCryptographyPrimitivesTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbEncryptionClientCallHistory - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - // The public method to be called by library consumers - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidState() - && input.ddbKeyBranchKeyIdSupplier.ValidState() - && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} - modifies Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies , - History`CreateDynamoDbEncryptionBranchKeyIdSupplier - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidState() - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && output.value.branchKeyIdSupplier.Modifies !! {History} - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) - ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] - -} - datatype DynamoDbEncryptionConfig = | DynamoDbEncryptionConfig ( - - ) - class IDynamoDbKeyBranchKeyIdSupplierCallHistory { - ghost constructor() { - GetBranchKeyIdFromDdbKey := []; -} - ghost var GetBranchKeyIdFromDdbKey: seq>> -} - trait {:termination false} IDynamoDbKeyBranchKeyIdSupplier - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; + // Begin Generated Types - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbKeyBranchKeyIdSupplierCallHistory - predicate GetBranchKeyIdFromDdbKeyEnsuresPublicly(input: GetBranchKeyIdFromDdbKeyInput , output: Result) - // The public method to be called by library consumers - method GetBranchKeyIdFromDdbKey ( input: GetBranchKeyIdFromDdbKeyInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetBranchKeyIdFromDdbKey - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) - ensures History.GetBranchKeyIdFromDdbKey == old(History.GetBranchKeyIdFromDdbKey) + [DafnyCallEvent(input, output)] - { - output := GetBranchKeyIdFromDdbKey' (input); - History.GetBranchKeyIdFromDdbKey := History.GetBranchKeyIdFromDdbKey + [DafnyCallEvent(input, output)]; -} - // The method to implement in the concrete class. - method GetBranchKeyIdFromDdbKey' ( input: GetBranchKeyIdFromDdbKeyInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) - ensures unchanged(History) - -} - datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig ( - nameonly logicalTableName: string , - nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , - nameonly sortKeyName: Option , - nameonly search: Option , - nameonly attributeActionsOnEncrypt: AttributeActions , - nameonly allowedUnsignedAttributes: Option , - nameonly allowedUnsignedAttributePrefix: Option , - nameonly algorithmSuiteId: Option , - nameonly keyring: Option , - nameonly cmm: Option , - nameonly legacyOverride: Option , - nameonly plaintextOverride: Option - ) - type DynamoDbTableEncryptionConfigList = map - datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig ( - nameonly tableEncryptionConfigs: DynamoDbTableEncryptionConfigList - ) - datatype EncryptedPart = | EncryptedPart ( - nameonly name: string , - nameonly prefix: Prefix - ) - type EncryptedPartsList = x: seq | IsValid_EncryptedPartsList(x) witness * - predicate method IsValid_EncryptedPartsList(x: seq) { - ( 1 <= |x| ) -} - datatype GetBranchKeyIdFromDdbKeyInput = | GetBranchKeyIdFromDdbKeyInput ( - nameonly ddbKey: ComAmazonawsDynamodbTypes.Key - ) - datatype GetBranchKeyIdFromDdbKeyOutput = | GetBranchKeyIdFromDdbKeyOutput ( - nameonly branchKeyId: string - ) - datatype GetPrefix = | GetPrefix ( - nameonly length: int32 - ) - datatype GetSegment = | GetSegment ( - nameonly split: Char , - nameonly index: int32 - ) - datatype GetSegments = | GetSegments ( - nameonly split: Char , - nameonly low: int32 , - nameonly high: int32 - ) - datatype GetSubstring = | GetSubstring ( - nameonly low: int32 , - nameonly high: int32 - ) - datatype GetSuffix = | GetSuffix ( - nameonly length: int32 - ) - datatype Insert = | Insert ( - nameonly literal: string - ) - class ILegacyDynamoDbEncryptorCallHistory { - ghost constructor() { - -} - -} - trait {:termination false} ILegacyDynamoDbEncryptor - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; + datatype AsSet = | AsSet ( - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: ILegacyDynamoDbEncryptorCallHistory - -} - datatype LegacyOverride = | LegacyOverride ( - nameonly policy: LegacyPolicy , - nameonly encryptor: ILegacyDynamoDbEncryptor , - nameonly attributeActionsOnEncrypt: AttributeActions , - nameonly defaultAttributeFlag: Option - ) - datatype LegacyPolicy = - | FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT - | FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT - | FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT - datatype Lower = | Lower ( - - ) - datatype MultiKeyStore = | MultiKeyStore ( - nameonly keyFieldName: string , - nameonly cacheTTL: int32 , - nameonly cache: Option - ) - datatype PartOnly = | PartOnly ( - - ) - datatype PlaintextOverride = - | FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ - | FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ - | FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ - type Prefix = x: string | IsValid_Prefix(x) witness * - predicate method IsValid_Prefix(x: string) { - ( 1 <= |x| ) -} - datatype SearchConfig = | SearchConfig ( - nameonly versions: BeaconVersionList , - nameonly writeVersion: VersionNumber - ) - datatype Shared = | Shared ( - nameonly other: string - ) - datatype SharedSet = | SharedSet ( - nameonly other: string - ) - datatype SignedPart = | SignedPart ( - nameonly name: string , - nameonly prefix: Prefix , - nameonly loc: Option - ) - type SignedPartsList = x: seq | IsValid_SignedPartsList(x) witness * - predicate method IsValid_SignedPartsList(x: seq) { - ( 1 <= |x| ) -} - datatype SingleKeyStore = | SingleKeyStore ( - nameonly keyId: string , - nameonly cacheTTL: int32 - ) - datatype StandardBeacon = | StandardBeacon ( - nameonly name: string , - nameonly length: BeaconBitLength , - nameonly loc: Option , - nameonly style: Option - ) - type StandardBeaconList = x: seq | IsValid_StandardBeaconList(x) witness * - predicate method IsValid_StandardBeaconList(x: seq) { - ( 1 <= |x| ) -} - type TerminalLocation = x: string | IsValid_TerminalLocation(x) witness * - predicate method IsValid_TerminalLocation(x: string) { - ( 1 <= |x| ) -} - datatype Upper = | Upper ( - - ) - type VersionNumber = x: int32 | IsValid_VersionNumber(x) witness * - predicate method IsValid_VersionNumber(x: int32) { - ( 1 <= x ) -} - datatype VirtualField = | VirtualField ( - nameonly name: string , - nameonly parts: VirtualPartList - ) - type VirtualFieldList = x: seq | IsValid_VirtualFieldList(x) witness * - predicate method IsValid_VirtualFieldList(x: seq) { - ( 1 <= |x| ) -} - datatype VirtualPart = | VirtualPart ( - nameonly loc: TerminalLocation , - nameonly trans: Option - ) - type VirtualPartList = x: seq | IsValid_VirtualPartList(x) witness * - predicate method IsValid_VirtualPartList(x: seq) { - ( 1 <= |x| ) -} - datatype VirtualTransform = - | upper(upper: Upper) - | lower(lower: Lower) - | insert(insert: Insert) - | prefix(prefix: GetPrefix) - | suffix(suffix: GetSuffix) - | substring(substring: GetSubstring) - | segment(segment: GetSegment) - | segments(segments: GetSegments) - type VirtualTransformList = x: seq | IsValid_VirtualTransformList(x) witness * - predicate method IsValid_VirtualTransformList(x: seq) { - ( 1 <= |x| ) -} - datatype Error = - // Local Error structures are listed here - | DynamoDbEncryptionException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyKeyStore(AwsCryptographyKeyStore: AwsCryptographyKeyStoreTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations - function method DefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig - method DynamoDbEncryption(config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() + ) + type AttributeActions = map + type BeaconBitLength = x: int32 | IsValid_BeaconBitLength(x) witness * + predicate method IsValid_BeaconBitLength(x: int32) { + ( 1 <= x <= 63 ) + } + datatype BeaconKeySource = + | single(single: SingleKeyStore) + | multi(multi: MultiKeyStore) + datatype BeaconStyle = + | partOnly(partOnly: PartOnly) + | shared(shared: Shared) + | asSet(asSet: AsSet) + | sharedSet(sharedSet: SharedSet) + datatype BeaconVersion = | BeaconVersion ( + nameonly version: VersionNumber , + nameonly keyStore: AwsCryptographyKeyStoreTypes.IKeyStoreClient , + nameonly keySource: BeaconKeySource , + nameonly standardBeacons: StandardBeaconList , + nameonly compoundBeacons: Option := Option.None , + nameonly virtualFields: Option := Option.None , + nameonly encryptedParts: Option := Option.None , + nameonly signedParts: Option := Option.None + ) + type BeaconVersionList = x: seq | IsValid_BeaconVersionList(x) witness * + predicate method IsValid_BeaconVersionList(x: seq) { + ( 1 <= |x| <= 1 ) + } + type Char = x: string | IsValid_Char(x) witness * + predicate method IsValid_Char(x: string) { + ( 1 <= |x| <= 1 ) + } + datatype CompoundBeacon = | CompoundBeacon ( + nameonly name: string , + nameonly split: Char , + nameonly encrypted: Option := Option.None , + nameonly signed: Option := Option.None , + nameonly constructors: Option := Option.None + ) + type CompoundBeaconList = x: seq | IsValid_CompoundBeaconList(x) witness * + predicate method IsValid_CompoundBeaconList(x: seq) { + ( 1 <= |x| ) + } + datatype Constructor = | Constructor ( + nameonly parts: ConstructorPartList + ) + type ConstructorList = x: seq | IsValid_ConstructorList(x) witness * + predicate method IsValid_ConstructorList(x: seq) { + ( 1 <= |x| ) + } + datatype ConstructorPart = | ConstructorPart ( + nameonly name: string , + nameonly required: bool + ) + type ConstructorPartList = x: seq | IsValid_ConstructorPartList(x) witness * + predicate method IsValid_ConstructorPartList(x: seq) { + ( 1 <= |x| ) + } + datatype CreateDynamoDbEncryptionBranchKeyIdSupplierInput = | CreateDynamoDbEncryptionBranchKeyIdSupplierInput ( + nameonly ddbKeyBranchKeyIdSupplier: IDynamoDbKeyBranchKeyIdSupplier + ) + datatype CreateDynamoDbEncryptionBranchKeyIdSupplierOutput = | CreateDynamoDbEncryptionBranchKeyIdSupplierOutput ( + nameonly branchKeyIdSupplier: AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier + ) + class IDynamoDbEncryptionClientCallHistory { + ghost constructor() { + CreateDynamoDbEncryptionBranchKeyIdSupplier := []; + } + ghost var CreateDynamoDbEncryptionBranchKeyIdSupplier: seq>> + } + trait {:termination false} IDynamoDbEncryptionClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; - class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - {Operations.CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidState() - && input.ddbKeyBranchKeyIdSupplier.ValidState() - && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} - modifies Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies , - History`CreateDynamoDbEncryptionBranchKeyIdSupplier - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidState() - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && output.value.branchKeyIdSupplier.Modifies !! {History} - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) - ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] - { - output := Operations.CreateDynamoDbEncryptionBranchKeyIdSupplier(config, input); - History.CreateDynamoDbEncryptionBranchKeyIdSupplier := History.CreateDynamoDbEncryptionBranchKeyIdSupplier + [DafnyCallEvent(input, output)]; -} - + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbEncryptionClientCallHistory + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + // The public method to be called by library consumers + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidState() + && input.ddbKeyBranchKeyIdSupplier.ValidState() + && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} + modifies Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies , + History`CreateDynamoDbEncryptionBranchKeyIdSupplier + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidState() + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && output.value.branchKeyIdSupplier.Modifies !! {History} + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] + + } + datatype DynamoDbEncryptionConfig = | DynamoDbEncryptionConfig ( + + ) + class IDynamoDbKeyBranchKeyIdSupplierCallHistory { + ghost constructor() { + GetBranchKeyIdFromDdbKey := []; + } + ghost var GetBranchKeyIdFromDdbKey: seq>> + } + trait {:termination false} IDynamoDbKeyBranchKeyIdSupplier + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbKeyBranchKeyIdSupplierCallHistory + predicate GetBranchKeyIdFromDdbKeyEnsuresPublicly(input: GetBranchKeyIdFromDdbKeyInput , output: Result) + // The public method to be called by library consumers + method GetBranchKeyIdFromDdbKey ( input: GetBranchKeyIdFromDdbKeyInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetBranchKeyIdFromDdbKey + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) + ensures History.GetBranchKeyIdFromDdbKey == old(History.GetBranchKeyIdFromDdbKey) + [DafnyCallEvent(input, output)] + { + output := GetBranchKeyIdFromDdbKey' (input); + History.GetBranchKeyIdFromDdbKey := History.GetBranchKeyIdFromDdbKey + [DafnyCallEvent(input, output)]; + } + // The method to implement in the concrete class. + method GetBranchKeyIdFromDdbKey' ( input: GetBranchKeyIdFromDdbKeyInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) + ensures unchanged(History) + + } + datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig ( + nameonly logicalTableName: string , + nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , + nameonly sortKeyName: Option := Option.None , + nameonly search: Option := Option.None , + nameonly attributeActionsOnEncrypt: AttributeActions , + nameonly allowedUnsignedAttributes: Option := Option.None , + nameonly allowedUnsignedAttributePrefix: Option := Option.None , + nameonly algorithmSuiteId: Option := Option.None , + nameonly keyring: Option := Option.None , + nameonly cmm: Option := Option.None , + nameonly legacyOverride: Option := Option.None , + nameonly plaintextOverride: Option := Option.None + ) + type DynamoDbTableEncryptionConfigList = map + datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig ( + nameonly tableEncryptionConfigs: DynamoDbTableEncryptionConfigList + ) + datatype EncryptedPart = | EncryptedPart ( + nameonly name: string , + nameonly prefix: Prefix + ) + type EncryptedPartsList = x: seq | IsValid_EncryptedPartsList(x) witness * + predicate method IsValid_EncryptedPartsList(x: seq) { + ( 1 <= |x| ) + } + datatype GetBranchKeyIdFromDdbKeyInput = | GetBranchKeyIdFromDdbKeyInput ( + nameonly ddbKey: ComAmazonawsDynamodbTypes.Key + ) + datatype GetBranchKeyIdFromDdbKeyOutput = | GetBranchKeyIdFromDdbKeyOutput ( + nameonly branchKeyId: string + ) + datatype GetPrefix = | GetPrefix ( + nameonly length: int32 + ) + datatype GetSegment = | GetSegment ( + nameonly split: Char , + nameonly index: int32 + ) + datatype GetSegments = | GetSegments ( + nameonly split: Char , + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSubstring = | GetSubstring ( + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSuffix = | GetSuffix ( + nameonly length: int32 + ) + datatype Insert = | Insert ( + nameonly literal: string + ) + class ILegacyDynamoDbEncryptorCallHistory { + ghost constructor() { + + } + + } + trait {:termination false} ILegacyDynamoDbEncryptor + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: ILegacyDynamoDbEncryptorCallHistory + + } + datatype LegacyOverride = | LegacyOverride ( + nameonly policy: LegacyPolicy , + nameonly encryptor: ILegacyDynamoDbEncryptor , + nameonly attributeActionsOnEncrypt: AttributeActions , + nameonly defaultAttributeFlag: Option := Option.None + ) + datatype LegacyPolicy = + | FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT + | FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT + | FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT + datatype Lower = | Lower ( + + ) + datatype MultiKeyStore = | MultiKeyStore ( + nameonly keyFieldName: string , + nameonly cacheTTL: int32 , + nameonly cache: Option := Option.None + ) + datatype PartOnly = | PartOnly ( + + ) + datatype PlaintextOverride = + | FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ + | FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ + | FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ + type Prefix = x: string | IsValid_Prefix(x) witness * + predicate method IsValid_Prefix(x: string) { + ( 1 <= |x| ) + } + datatype SearchConfig = | SearchConfig ( + nameonly versions: BeaconVersionList , + nameonly writeVersion: VersionNumber + ) + datatype Shared = | Shared ( + nameonly other: string + ) + datatype SharedSet = | SharedSet ( + nameonly other: string + ) + datatype SignedPart = | SignedPart ( + nameonly name: string , + nameonly prefix: Prefix , + nameonly loc: Option := Option.None + ) + type SignedPartsList = x: seq | IsValid_SignedPartsList(x) witness * + predicate method IsValid_SignedPartsList(x: seq) { + ( 1 <= |x| ) + } + datatype SingleKeyStore = | SingleKeyStore ( + nameonly keyId: string , + nameonly cacheTTL: int32 + ) + datatype StandardBeacon = | StandardBeacon ( + nameonly name: string , + nameonly length: BeaconBitLength , + nameonly loc: Option := Option.None , + nameonly style: Option := Option.None + ) + type StandardBeaconList = x: seq | IsValid_StandardBeaconList(x) witness * + predicate method IsValid_StandardBeaconList(x: seq) { + ( 1 <= |x| ) + } + type TerminalLocation = x: string | IsValid_TerminalLocation(x) witness * + predicate method IsValid_TerminalLocation(x: string) { + ( 1 <= |x| ) + } + datatype Upper = | Upper ( + + ) + type VersionNumber = x: int32 | IsValid_VersionNumber(x) witness * + predicate method IsValid_VersionNumber(x: int32) { + ( 1 <= x ) + } + datatype VirtualField = | VirtualField ( + nameonly name: string , + nameonly parts: VirtualPartList + ) + type VirtualFieldList = x: seq | IsValid_VirtualFieldList(x) witness * + predicate method IsValid_VirtualFieldList(x: seq) { + ( 1 <= |x| ) + } + datatype VirtualPart = | VirtualPart ( + nameonly loc: TerminalLocation , + nameonly trans: Option := Option.None + ) + type VirtualPartList = x: seq | IsValid_VirtualPartList(x) witness * + predicate method IsValid_VirtualPartList(x: seq) { + ( 1 <= |x| ) + } + datatype VirtualTransform = + | upper(upper: Upper) + | lower(lower: Lower) + | insert(insert: Insert) + | prefix(prefix: GetPrefix) + | suffix(suffix: GetSuffix) + | substring(substring: GetSubstring) + | segment(segment: GetSegment) + | segments(segments: GetSegments) + type VirtualTransformList = x: seq | IsValid_VirtualTransformList(x) witness * + predicate method IsValid_VirtualTransformList(x: seq) { + ( 1 <= |x| ) + } + datatype Error = + // Local Error structures are listed here + | DynamoDbEncryptionException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyKeyStore(AwsCryptographyKeyStore: AwsCryptographyKeyStoreTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations + function method DefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig + method DynamoDbEncryption(config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbEncryptionClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + {Operations.CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidState() + && input.ddbKeyBranchKeyIdSupplier.ValidState() + && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} + modifies Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies , + History`CreateDynamoDbEncryptionBranchKeyIdSupplier + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidState() + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && output.value.branchKeyIdSupplier.Modifies !! {History} + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] + { + output := Operations.CreateDynamoDbEncryptionBranchKeyIdSupplier(config, input); + History.CreateDynamoDbEncryptionBranchKeyIdSupplier := History.CreateDynamoDbEncryptionBranchKeyIdSupplier + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + // The private method to be refined by the library developer - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( config: InternalConfig , input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.ddbKeyBranchKeyIdSupplier.ValidState() - modifies ModifiesInternalConfig(config) , - input.ddbKeyBranchKeyIdSupplier.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidInternalConfig?(config) - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - ModifiesInternalConfig(config) - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( config: InternalConfig , input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.ddbKeyBranchKeyIdSupplier.ValidState() + modifies ModifiesInternalConfig(config) , + input.ddbKeyBranchKeyIdSupplier.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidInternalConfig?(config) + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - ModifiesInternalConfig(config) - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy index 2703b9023..c9d57666a 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy @@ -28,7 +28,7 @@ module } method DynamoDbEncryption(config: DynamoDbEncryptionConfig) - returns (res: Result) + returns (res: Result) { var internalConfig := Operations.Config(); var client := new DynamoDbEncryptionClient(internalConfig); diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy index 8d9f2b539..6bca0c2f9 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy @@ -2,1854 +2,1819 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../DynamoDbEncryption/src/Index.dfy" - include "../../DynamoDbItemEncryptor/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkDynamoDbTypes - import AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype BatchExecuteStatementInputTransformInput = | BatchExecuteStatementInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementInputTransformOutput = | BatchExecuteStatementInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementOutputTransformInput = | BatchExecuteStatementOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementOutputTransformOutput = | BatchExecuteStatementOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput - ) - datatype BatchGetItemInputTransformInput = | BatchGetItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemInputTransformOutput = | BatchGetItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemOutputTransformInput = | BatchGetItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemOutputTransformOutput = | BatchGetItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput - ) - datatype BatchWriteItemInputTransformInput = | BatchWriteItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemInputTransformOutput = | BatchWriteItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemOutputTransformInput = | BatchWriteItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemOutputTransformOutput = | BatchWriteItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput - ) - datatype DeleteItemInputTransformInput = | DeleteItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemInputTransformOutput = | DeleteItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemOutputTransformInput = | DeleteItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemOutputTransformOutput = | DeleteItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput - ) - class IDynamoDbEncryptionTransformsClientCallHistory { - ghost constructor() { - PutItemInputTransform := []; - PutItemOutputTransform := []; - GetItemInputTransform := []; - GetItemOutputTransform := []; - BatchWriteItemInputTransform := []; - BatchWriteItemOutputTransform := []; - BatchGetItemInputTransform := []; - BatchGetItemOutputTransform := []; - ScanInputTransform := []; - ScanOutputTransform := []; - QueryInputTransform := []; - QueryOutputTransform := []; - TransactWriteItemsInputTransform := []; - TransactWriteItemsOutputTransform := []; - UpdateItemInputTransform := []; - UpdateItemOutputTransform := []; - DeleteItemInputTransform := []; - DeleteItemOutputTransform := []; - TransactGetItemsInputTransform := []; - TransactGetItemsOutputTransform := []; - ExecuteStatementInputTransform := []; - ExecuteStatementOutputTransform := []; - BatchExecuteStatementInputTransform := []; - BatchExecuteStatementOutputTransform := []; - ExecuteTransactionInputTransform := []; - ExecuteTransactionOutputTransform := []; - ResolveAttributes := []; +include "../../DynamoDbEncryption/src/Index.dfy" +include "../../DynamoDbItemEncryptor/src/Index.dfy" +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkDynamoDbTypes + import AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) + + // Begin Generated Types + + datatype BatchExecuteStatementInputTransformInput = | BatchExecuteStatementInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementInputTransformOutput = | BatchExecuteStatementInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementOutputTransformInput = | BatchExecuteStatementOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementOutputTransformOutput = | BatchExecuteStatementOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput + ) + datatype BatchGetItemInputTransformInput = | BatchGetItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemInputTransformOutput = | BatchGetItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemOutputTransformInput = | BatchGetItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemOutputTransformOutput = | BatchGetItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput + ) + datatype BatchWriteItemInputTransformInput = | BatchWriteItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemInputTransformOutput = | BatchWriteItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemOutputTransformInput = | BatchWriteItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemOutputTransformOutput = | BatchWriteItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput + ) + datatype DeleteItemInputTransformInput = | DeleteItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemInputTransformOutput = | DeleteItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemOutputTransformInput = | DeleteItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemOutputTransformOutput = | DeleteItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput + ) + class IDynamoDbEncryptionTransformsClientCallHistory { + ghost constructor() { + PutItemInputTransform := []; + PutItemOutputTransform := []; + GetItemInputTransform := []; + GetItemOutputTransform := []; + BatchWriteItemInputTransform := []; + BatchWriteItemOutputTransform := []; + BatchGetItemInputTransform := []; + BatchGetItemOutputTransform := []; + ScanInputTransform := []; + ScanOutputTransform := []; + QueryInputTransform := []; + QueryOutputTransform := []; + TransactWriteItemsInputTransform := []; + TransactWriteItemsOutputTransform := []; + UpdateItemInputTransform := []; + UpdateItemOutputTransform := []; + DeleteItemInputTransform := []; + DeleteItemOutputTransform := []; + TransactGetItemsInputTransform := []; + TransactGetItemsOutputTransform := []; + ExecuteStatementInputTransform := []; + ExecuteStatementOutputTransform := []; + BatchExecuteStatementInputTransform := []; + BatchExecuteStatementOutputTransform := []; + ExecuteTransactionInputTransform := []; + ExecuteTransactionOutputTransform := []; + ResolveAttributes := []; + } + ghost var PutItemInputTransform: seq>> + ghost var PutItemOutputTransform: seq>> + ghost var GetItemInputTransform: seq>> + ghost var GetItemOutputTransform: seq>> + ghost var BatchWriteItemInputTransform: seq>> + ghost var BatchWriteItemOutputTransform: seq>> + ghost var BatchGetItemInputTransform: seq>> + ghost var BatchGetItemOutputTransform: seq>> + ghost var ScanInputTransform: seq>> + ghost var ScanOutputTransform: seq>> + ghost var QueryInputTransform: seq>> + ghost var QueryOutputTransform: seq>> + ghost var TransactWriteItemsInputTransform: seq>> + ghost var TransactWriteItemsOutputTransform: seq>> + ghost var UpdateItemInputTransform: seq>> + ghost var UpdateItemOutputTransform: seq>> + ghost var DeleteItemInputTransform: seq>> + ghost var DeleteItemOutputTransform: seq>> + ghost var TransactGetItemsInputTransform: seq>> + ghost var TransactGetItemsOutputTransform: seq>> + ghost var ExecuteStatementInputTransform: seq>> + ghost var ExecuteStatementOutputTransform: seq>> + ghost var BatchExecuteStatementInputTransform: seq>> + ghost var BatchExecuteStatementOutputTransform: seq>> + ghost var ExecuteTransactionInputTransform: seq>> + ghost var ExecuteTransactionOutputTransform: seq>> + ghost var ResolveAttributes: seq>> + } + trait {:termination false} IDynamoDbEncryptionTransformsClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbEncryptionTransformsClientCallHistory + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method PutItemInputTransform ( input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemInputTransformEnsuresPublicly(input, output) + ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method PutItemOutputTransform ( input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemOutputTransformEnsuresPublicly(input, output) + ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method GetItemInputTransform ( input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemInputTransformEnsuresPublicly(input, output) + ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method GetItemOutputTransform ( input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemOutputTransformEnsuresPublicly(input, output) + ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + // The public method to be called by library consumers + method ScanInputTransform ( input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanInputTransformEnsuresPublicly(input, output) + ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] + + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ScanOutputTransform ( input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanOutputTransformEnsuresPublicly(input, output) + ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] + + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + // The public method to be called by library consumers + method QueryInputTransform ( input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryInputTransformEnsuresPublicly(input, output) + ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] + + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + // The public method to be called by library consumers + method QueryOutputTransform ( input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryOutputTransformEnsuresPublicly(input, output) + ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] + + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemInputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemInputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + // The public method to be called by library consumers + method ResolveAttributes ( input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ResolveAttributes + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ResolveAttributesEnsuresPublicly(input, output) + ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] + + } + datatype ExecuteStatementInputTransformInput = | ExecuteStatementInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementInputTransformOutput = | ExecuteStatementInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementOutputTransformInput = | ExecuteStatementOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementOutputTransformOutput = | ExecuteStatementOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput + ) + datatype ExecuteTransactionInputTransformInput = | ExecuteTransactionInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionInputTransformOutput = | ExecuteTransactionInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionOutputTransformInput = | ExecuteTransactionOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionOutputTransformOutput = | ExecuteTransactionOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput + ) + datatype GetItemInputTransformInput = | GetItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemInputTransformOutput = | GetItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemOutputTransformInput = | GetItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.GetItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemOutputTransformOutput = | GetItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.GetItemOutput + ) + datatype PutItemInputTransformInput = | PutItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemInputTransformOutput = | PutItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemOutputTransformInput = | PutItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.PutItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemOutputTransformOutput = | PutItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.PutItemOutput + ) + datatype QueryInputTransformInput = | QueryInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryInputTransformOutput = | QueryInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryOutputTransformInput = | QueryOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.QueryOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryOutputTransformOutput = | QueryOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.QueryOutput + ) + datatype ResolveAttributesInput = | ResolveAttributesInput ( + nameonly TableName: ComAmazonawsDynamodbTypes.TableName , + nameonly Item: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly Version: Option := Option.None + ) + datatype ResolveAttributesOutput = | ResolveAttributesOutput ( + nameonly VirtualFields: StringMap , + nameonly CompoundBeacons: StringMap + ) + datatype ScanInputTransformInput = | ScanInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanInputTransformOutput = | ScanInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanOutputTransformInput = | ScanOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ScanOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanOutputTransformOutput = | ScanOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ScanOutput + ) + type StringMap = map + datatype TransactGetItemsInputTransformInput = | TransactGetItemsInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsInputTransformOutput = | TransactGetItemsInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsOutputTransformInput = | TransactGetItemsOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsOutputTransformOutput = | TransactGetItemsOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput + ) + datatype TransactWriteItemsInputTransformInput = | TransactWriteItemsInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsInputTransformOutput = | TransactWriteItemsInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsOutputTransformInput = | TransactWriteItemsOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsOutputTransformOutput = | TransactWriteItemsOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput + ) + datatype UpdateItemInputTransformInput = | UpdateItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemInputTransformOutput = | UpdateItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemOutputTransformInput = | UpdateItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemOutputTransformOutput = | UpdateItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput + ) + datatype Error = + // Local Error structures are listed here + | DynamoDbEncryptionTransformsException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) + | AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor(AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor: AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.Error) + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } - ghost var PutItemInputTransform: seq>> - ghost var PutItemOutputTransform: seq>> - ghost var GetItemInputTransform: seq>> - ghost var GetItemOutputTransform: seq>> - ghost var BatchWriteItemInputTransform: seq>> - ghost var BatchWriteItemOutputTransform: seq>> - ghost var BatchGetItemInputTransform: seq>> - ghost var BatchGetItemOutputTransform: seq>> - ghost var ScanInputTransform: seq>> - ghost var ScanOutputTransform: seq>> - ghost var QueryInputTransform: seq>> - ghost var QueryOutputTransform: seq>> - ghost var TransactWriteItemsInputTransform: seq>> - ghost var TransactWriteItemsOutputTransform: seq>> - ghost var UpdateItemInputTransform: seq>> - ghost var UpdateItemOutputTransform: seq>> - ghost var DeleteItemInputTransform: seq>> - ghost var DeleteItemOutputTransform: seq>> - ghost var TransactGetItemsInputTransform: seq>> - ghost var TransactGetItemsOutputTransform: seq>> - ghost var ExecuteStatementInputTransform: seq>> - ghost var ExecuteStatementOutputTransform: seq>> - ghost var BatchExecuteStatementInputTransform: seq>> - ghost var BatchExecuteStatementOutputTransform: seq>> - ghost var ExecuteTransactionInputTransform: seq>> - ghost var ExecuteTransactionOutputTransform: seq>> - ghost var ResolveAttributes: seq>> +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations + function method DefaultDynamoDbTablesEncryptionConfig(): AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig + method DynamoDbEncryptionTransforms(config: AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig := DefaultDynamoDbTablesEncryptionConfig()) + returns (res: Result) + requires var tmps0 := set t0 | t0 in config.tableEncryptionConfigs.Values; + forall tmp0 :: tmp0 in tmps0 ==> + tmp0.keyring.Some? ==> + tmp0.keyring.value.ValidState() + requires var tmps1 := set t1 | t1 in config.tableEncryptionConfigs.Values; + forall tmp1 :: tmp1 in tmps1 ==> + tmp1.cmm.Some? ==> + tmp1.cmm.value.ValidState() + requires var tmps2 := set t2 | t2 in config.tableEncryptionConfigs.Values; + forall tmp2 :: tmp2 in tmps2 ==> + tmp2.legacyOverride.Some? ==> + tmp2.legacyOverride.value.encryptor.ValidState() + requires var tmps3 := set t3 | t3 in config.tableEncryptionConfigs.Values; + forall tmp3 :: tmp3 in tmps3 ==> + tmp3.search.Some? ==> + var tmps4 := set t4 | t4 in tmp3.search.value.versions; + forall tmp4 :: tmp4 in tmps4 ==> + tmp4.keyStore.ValidState() + modifies set tmps5 <- set t5 <- config.tableEncryptionConfigs.Values | true + && t5.keyring.Some? + :: t5.keyring.value, + obj <- tmps5.Modifies | obj in tmps5.Modifies :: obj + modifies set tmps6 <- set t6 <- config.tableEncryptionConfigs.Values | true + && t6.cmm.Some? + :: t6.cmm.value, + obj <- tmps6.Modifies | obj in tmps6.Modifies :: obj + modifies set tmps7 <- set t7 <- config.tableEncryptionConfigs.Values | true + && t7.legacyOverride.Some? + :: t7.legacyOverride.value.encryptor, + obj <- tmps7.Modifies | obj in tmps7.Modifies :: obj + modifies set tmps8 <- set t8 <- config.tableEncryptionConfigs.Values | true + && t8.search.Some? + , t9 <- t8.search.value.versions :: t9.keyStore, + obj <- tmps8.Modifies | obj in tmps8.Modifies :: obj + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies + - ( set tmps10 <- set t10 <- config.tableEncryptionConfigs.Values | true + && t10.keyring.Some? + :: t10.keyring.value, + obj <- tmps10.Modifies | obj in tmps10.Modifies :: obj + ) - ( set tmps11 <- set t11 <- config.tableEncryptionConfigs.Values | true + && t11.cmm.Some? + :: t11.cmm.value, + obj <- tmps11.Modifies | obj in tmps11.Modifies :: obj + ) - ( set tmps12 <- set t12 <- config.tableEncryptionConfigs.Values | true + && t12.legacyOverride.Some? + :: t12.legacyOverride.value.encryptor, + obj <- tmps12.Modifies | obj in tmps12.Modifies :: obj + ) - ( set tmps13 <- set t13 <- config.tableEncryptionConfigs.Values | true + && t13.search.Some? + , t14 <- t13.search.value.versions :: t14.keyStore, + obj <- tmps13.Modifies | obj in tmps13.Modifies :: obj + ) ) + && fresh(res.value.History) + && res.value.ValidState() + ensures var tmps15 := set t15 | t15 in config.tableEncryptionConfigs.Values; + forall tmp15 :: tmp15 in tmps15 ==> + tmp15.keyring.Some? ==> + tmp15.keyring.value.ValidState() + ensures var tmps16 := set t16 | t16 in config.tableEncryptionConfigs.Values; + forall tmp16 :: tmp16 in tmps16 ==> + tmp16.cmm.Some? ==> + tmp16.cmm.value.ValidState() + ensures var tmps17 := set t17 | t17 in config.tableEncryptionConfigs.Values; + forall tmp17 :: tmp17 in tmps17 ==> + tmp17.legacyOverride.Some? ==> + tmp17.legacyOverride.value.encryptor.ValidState() + ensures var tmps18 := set t18 | t18 in config.tableEncryptionConfigs.Values; + forall tmp18 :: tmp18 in tmps18 ==> + tmp18.search.Some? ==> + var tmps19 := set t19 | t19 in tmp18.search.value.versions; + forall tmp19 :: tmp19 in tmps19 ==> + tmp19.keyStore.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbEncryptionTransformsClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbEncryptionTransformsClient extends IDynamoDbEncryptionTransformsClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + {Operations.PutItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method PutItemInputTransform ( input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemInputTransformEnsuresPublicly(input, output) + ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.PutItemInputTransform(config, input); + History.PutItemInputTransform := History.PutItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + {Operations.PutItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method PutItemOutputTransform ( input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemOutputTransformEnsuresPublicly(input, output) + ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.PutItemOutputTransform(config, input); + History.PutItemOutputTransform := History.PutItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + {Operations.GetItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method GetItemInputTransform ( input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemInputTransformEnsuresPublicly(input, output) + ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.GetItemInputTransform(config, input); + History.GetItemInputTransform := History.GetItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + {Operations.GetItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method GetItemOutputTransform ( input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemOutputTransformEnsuresPublicly(input, output) + ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.GetItemOutputTransform(config, input); + History.GetItemOutputTransform := History.GetItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + {Operations.BatchWriteItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchWriteItemInputTransform(config, input); + History.BatchWriteItemInputTransform := History.BatchWriteItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + {Operations.BatchWriteItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchWriteItemOutputTransform(config, input); + History.BatchWriteItemOutputTransform := History.BatchWriteItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + {Operations.BatchGetItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchGetItemInputTransform(config, input); + History.BatchGetItemInputTransform := History.BatchGetItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + {Operations.BatchGetItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchGetItemOutputTransform(config, input); + History.BatchGetItemOutputTransform := History.BatchGetItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + {Operations.ScanInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ScanInputTransform ( input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanInputTransformEnsuresPublicly(input, output) + ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ScanInputTransform(config, input); + History.ScanInputTransform := History.ScanInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + {Operations.ScanOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ScanOutputTransform ( input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanOutputTransformEnsuresPublicly(input, output) + ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ScanOutputTransform(config, input); + History.ScanOutputTransform := History.ScanOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + {Operations.QueryInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method QueryInputTransform ( input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryInputTransformEnsuresPublicly(input, output) + ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.QueryInputTransform(config, input); + History.QueryInputTransform := History.QueryInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + {Operations.QueryOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method QueryOutputTransform ( input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryOutputTransformEnsuresPublicly(input, output) + ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.QueryOutputTransform(config, input); + History.QueryOutputTransform := History.QueryOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + {Operations.TransactWriteItemsInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactWriteItemsInputTransform(config, input); + History.TransactWriteItemsInputTransform := History.TransactWriteItemsInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + {Operations.TransactWriteItemsOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactWriteItemsOutputTransform(config, input); + History.TransactWriteItemsOutputTransform := History.TransactWriteItemsOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + {Operations.UpdateItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemInputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.UpdateItemInputTransform(config, input); + History.UpdateItemInputTransform := History.UpdateItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + {Operations.UpdateItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.UpdateItemOutputTransform(config, input); + History.UpdateItemOutputTransform := History.UpdateItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + {Operations.DeleteItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemInputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.DeleteItemInputTransform(config, input); + History.DeleteItemInputTransform := History.DeleteItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + {Operations.DeleteItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.DeleteItemOutputTransform(config, input); + History.DeleteItemOutputTransform := History.DeleteItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + {Operations.TransactGetItemsInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactGetItemsInputTransform(config, input); + History.TransactGetItemsInputTransform := History.TransactGetItemsInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + {Operations.TransactGetItemsOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactGetItemsOutputTransform(config, input); + History.TransactGetItemsOutputTransform := History.TransactGetItemsOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + {Operations.ExecuteStatementInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteStatementInputTransform(config, input); + History.ExecuteStatementInputTransform := History.ExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + {Operations.ExecuteStatementOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteStatementOutputTransform(config, input); + History.ExecuteStatementOutputTransform := History.ExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + {Operations.BatchExecuteStatementInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchExecuteStatementInputTransform(config, input); + History.BatchExecuteStatementInputTransform := History.BatchExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + {Operations.BatchExecuteStatementOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchExecuteStatementOutputTransform(config, input); + History.BatchExecuteStatementOutputTransform := History.BatchExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + {Operations.ExecuteTransactionInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteTransactionInputTransform(config, input); + History.ExecuteTransactionInputTransform := History.ExecuteTransactionInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + {Operations.ExecuteTransactionOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteTransactionOutputTransform(config, input); + History.ExecuteTransactionOutputTransform := History.ExecuteTransactionOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + {Operations.ResolveAttributesEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ResolveAttributes ( input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ResolveAttributes + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ResolveAttributesEnsuresPublicly(input, output) + ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] + { + output := Operations.ResolveAttributes(config, input); + History.ResolveAttributes := History.ResolveAttributes + [DafnyCallEvent(input, output)]; + } + + } } - trait {:termination false} IDynamoDbEncryptionTransformsClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; - - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbEncryptionTransformsClientCallHistory - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method PutItemInputTransform ( input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemInputTransformEnsuresPublicly(input, output) - ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method PutItemOutputTransform ( input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemOutputTransformEnsuresPublicly(input, output) - ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method GetItemInputTransform ( input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemInputTransformEnsuresPublicly(input, output) - ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method GetItemOutputTransform ( input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemOutputTransformEnsuresPublicly(input, output) - ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - // The public method to be called by library consumers - method ScanInputTransform ( input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanInputTransformEnsuresPublicly(input, output) - ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] - - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ScanOutputTransform ( input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanOutputTransformEnsuresPublicly(input, output) - ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] - - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - // The public method to be called by library consumers - method QueryInputTransform ( input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryInputTransformEnsuresPublicly(input, output) - ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] - - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - // The public method to be called by library consumers - method QueryOutputTransform ( input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryOutputTransformEnsuresPublicly(input, output) - ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] - - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemInputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemInputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - // The public method to be called by library consumers - method ResolveAttributes ( input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ResolveAttributes - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ResolveAttributesEnsuresPublicly(input, output) - ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] - -} - datatype ExecuteStatementInputTransformInput = | ExecuteStatementInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementInputTransformOutput = | ExecuteStatementInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementOutputTransformInput = | ExecuteStatementOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementOutputTransformOutput = | ExecuteStatementOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput - ) - datatype ExecuteTransactionInputTransformInput = | ExecuteTransactionInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionInputTransformOutput = | ExecuteTransactionInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionOutputTransformInput = | ExecuteTransactionOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionOutputTransformOutput = | ExecuteTransactionOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput - ) - datatype GetItemInputTransformInput = | GetItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemInputTransformOutput = | GetItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemOutputTransformInput = | GetItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.GetItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemOutputTransformOutput = | GetItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.GetItemOutput - ) - datatype PutItemInputTransformInput = | PutItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemInputTransformOutput = | PutItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemOutputTransformInput = | PutItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.PutItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemOutputTransformOutput = | PutItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.PutItemOutput - ) - datatype QueryInputTransformInput = | QueryInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryInputTransformOutput = | QueryInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryOutputTransformInput = | QueryOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.QueryOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryOutputTransformOutput = | QueryOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.QueryOutput - ) - datatype ResolveAttributesInput = | ResolveAttributesInput ( - nameonly TableName: ComAmazonawsDynamodbTypes.TableName , - nameonly Item: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly Version: Option - ) - datatype ResolveAttributesOutput = | ResolveAttributesOutput ( - nameonly VirtualFields: StringMap , - nameonly CompoundBeacons: StringMap - ) - datatype ScanInputTransformInput = | ScanInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanInputTransformOutput = | ScanInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanOutputTransformInput = | ScanOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ScanOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanOutputTransformOutput = | ScanOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ScanOutput - ) - type StringMap = map - datatype TransactGetItemsInputTransformInput = | TransactGetItemsInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsInputTransformOutput = | TransactGetItemsInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsOutputTransformInput = | TransactGetItemsOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsOutputTransformOutput = | TransactGetItemsOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput - ) - datatype TransactWriteItemsInputTransformInput = | TransactWriteItemsInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsInputTransformOutput = | TransactWriteItemsInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsOutputTransformInput = | TransactWriteItemsOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsOutputTransformOutput = | TransactWriteItemsOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput - ) - datatype UpdateItemInputTransformInput = | UpdateItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemInputTransformOutput = | UpdateItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemOutputTransformInput = | UpdateItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemOutputTransformOutput = | UpdateItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput - ) - datatype Error = - // Local Error structures are listed here - | DynamoDbEncryptionTransformsException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) - | AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor(AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor: AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.Error) - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations - function method DefaultDynamoDbTablesEncryptionConfig(): AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig - method DynamoDbEncryptionTransforms(config: AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig := DefaultDynamoDbTablesEncryptionConfig()) - returns (res: Result) -// BEGIN MANUAL EDIT - requires var tmps0 := set t0 | t0 in config.tableEncryptionConfigs.Values; - forall tmp0 :: tmp0 in tmps0 ==> - tmp0.keyring.Some? ==> - tmp0.keyring.value.ValidState() - requires var tmps1 := set t1 | t1 in config.tableEncryptionConfigs.Values; - forall tmp1 :: tmp1 in tmps1 ==> - tmp1.cmm.Some? ==> - tmp1.cmm.value.ValidState() - requires var tmps2 := set t2 | t2 in config.tableEncryptionConfigs.Values; - forall tmp2 :: tmp2 in tmps2 ==> - tmp2.legacyOverride.Some? ==> - tmp2.legacyOverride.value.encryptor.ValidState() - requires var tmps3 := set t3 | t3 in config.tableEncryptionConfigs.Values; - forall tmp3 :: tmp3 in tmps3 ==> - tmp3.search.Some? ==> - var tmps4 := set t4 | t4 in tmp3.search.value.versions; - forall tmp4 :: tmp4 in tmps4 ==> - tmp4.keyStore.ValidState() - modifies var tmps5 := set t5 | t5 in config.tableEncryptionConfigs.Values - && t5.keyring.Some? - :: t5.keyring.value; - var tmps5FlattenedModifiesSet: set> := set t0 - | t0 in tmps5 :: t0.Modifies; - (set tmp6ModifyEntry, tmp6Modifies | - tmp6Modifies in tmps5FlattenedModifiesSet - && tmp6ModifyEntry in tmp6Modifies - :: tmp6ModifyEntry) - modifies var tmps7 := set t7 | t7 in config.tableEncryptionConfigs.Values - && t7.cmm.Some? - :: t7.cmm.value; - var tmps7FlattenedModifiesSet: set> := set t0 - | t0 in tmps7 :: t0.Modifies; - (set tmp8ModifyEntry, tmp8Modifies | - tmp8Modifies in tmps7FlattenedModifiesSet - && tmp8ModifyEntry in tmp8Modifies - :: tmp8ModifyEntry) - modifies var tmps9 := set t9 | t9 in config.tableEncryptionConfigs.Values - && t9.legacyOverride.Some? - :: t9.legacyOverride.value.encryptor; - var tmps9FlattenedModifiesSet: set> := set t0 - | t0 in tmps9 :: t0.Modifies; - (set tmp10ModifyEntry, tmp10Modifies | - tmp10Modifies in tmps9FlattenedModifiesSet - && tmp10ModifyEntry in tmp10Modifies - :: tmp10ModifyEntry) - modifies var tmps11 := set t11 | t11 in config.tableEncryptionConfigs.Values - && t11.search.Some? - :: set t12 | t12 in t11.search.value.versions :: t12.keyStore; - var tmps11FlattenedModifiesSet: set> := set t0 -, t1 | t0 in tmps11 && t1 in t0 :: t1.Modifies; - (set tmp13ModifyEntry, tmp13Modifies | - tmp13Modifies in tmps11FlattenedModifiesSet - && tmp13ModifyEntry in tmp13Modifies - :: tmp13ModifyEntry) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies - - ( var tmps14 := set t14 | t14 in config.tableEncryptionConfigs.Values - && t14.keyring.Some? - :: t14.keyring.value; - var tmps14FlattenedModifiesSet: set> := set t0 - | t0 in tmps14 :: t0.Modifies; - (set tmp15ModifyEntry, tmp15Modifies | - tmp15Modifies in tmps14FlattenedModifiesSet - && tmp15ModifyEntry in tmp15Modifies - :: tmp15ModifyEntry) - ) - ( var tmps16 := set t16 | t16 in config.tableEncryptionConfigs.Values - && t16.cmm.Some? - :: t16.cmm.value; - var tmps16FlattenedModifiesSet: set> := set t0 - | t0 in tmps16 :: t0.Modifies; - (set tmp17ModifyEntry, tmp17Modifies | - tmp17Modifies in tmps16FlattenedModifiesSet - && tmp17ModifyEntry in tmp17Modifies - :: tmp17ModifyEntry) - ) - ( var tmps18 := set t18 | t18 in config.tableEncryptionConfigs.Values - && t18.legacyOverride.Some? - :: t18.legacyOverride.value.encryptor; - var tmps18FlattenedModifiesSet: set> := set t0 - | t0 in tmps18 :: t0.Modifies; - (set tmp19ModifyEntry, tmp19Modifies | - tmp19Modifies in tmps18FlattenedModifiesSet - && tmp19ModifyEntry in tmp19Modifies - :: tmp19ModifyEntry) - ) - ( var tmps20 := set t20 | t20 in config.tableEncryptionConfigs.Values - && t20.search.Some? - :: set t21 | t21 in t20.search.value.versions :: t21.keyStore; - var tmps20FlattenedModifiesSet: set> := set t0 -, t1 | t0 in tmps20 && t1 in t0 :: t1.Modifies; - (set tmp22ModifyEntry, tmp22Modifies | - tmp22Modifies in tmps20FlattenedModifiesSet - && tmp22ModifyEntry in tmp22Modifies - :: tmp22ModifyEntry) - ) ) - && fresh(res.value.History) - && res.value.ValidState() - ensures var tmps23 := set t23 | t23 in config.tableEncryptionConfigs.Values; - forall tmp23 :: tmp23 in tmps23 ==> - tmp23.keyring.Some? ==> - tmp23.keyring.value.ValidState() - ensures var tmps24 := set t24 | t24 in config.tableEncryptionConfigs.Values; - forall tmp24 :: tmp24 in tmps24 ==> - tmp24.cmm.Some? ==> - tmp24.cmm.value.ValidState() - ensures var tmps25 := set t25 | t25 in config.tableEncryptionConfigs.Values; - forall tmp25 :: tmp25 in tmps25 ==> - tmp25.legacyOverride.Some? ==> - tmp25.legacyOverride.value.encryptor.ValidState() - ensures var tmps26 := set t26 | t26 in config.tableEncryptionConfigs.Values; - forall tmp26 :: tmp26 in tmps26 ==> - tmp26.search.Some? ==> - var tmps27 := set t27 | t27 in tmp26.search.value.versions; - forall tmp27 :: tmp27 in tmps27 ==> - tmp27.keyStore.ValidState() -// END MANUAL EDIT - - class DynamoDbEncryptionTransformsClient extends IDynamoDbEncryptionTransformsClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - {Operations.PutItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method PutItemInputTransform ( input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemInputTransformEnsuresPublicly(input, output) - ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.PutItemInputTransform(config, input); - History.PutItemInputTransform := History.PutItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - {Operations.PutItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method PutItemOutputTransform ( input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemOutputTransformEnsuresPublicly(input, output) - ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.PutItemOutputTransform(config, input); - History.PutItemOutputTransform := History.PutItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - {Operations.GetItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method GetItemInputTransform ( input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemInputTransformEnsuresPublicly(input, output) - ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.GetItemInputTransform(config, input); - History.GetItemInputTransform := History.GetItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - {Operations.GetItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method GetItemOutputTransform ( input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemOutputTransformEnsuresPublicly(input, output) - ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.GetItemOutputTransform(config, input); - History.GetItemOutputTransform := History.GetItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - {Operations.BatchWriteItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchWriteItemInputTransform(config, input); - History.BatchWriteItemInputTransform := History.BatchWriteItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - {Operations.BatchWriteItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchWriteItemOutputTransform(config, input); - History.BatchWriteItemOutputTransform := History.BatchWriteItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - {Operations.BatchGetItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchGetItemInputTransform(config, input); - History.BatchGetItemInputTransform := History.BatchGetItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - {Operations.BatchGetItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchGetItemOutputTransform(config, input); - History.BatchGetItemOutputTransform := History.BatchGetItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - {Operations.ScanInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ScanInputTransform ( input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanInputTransformEnsuresPublicly(input, output) - ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ScanInputTransform(config, input); - History.ScanInputTransform := History.ScanInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - {Operations.ScanOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ScanOutputTransform ( input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanOutputTransformEnsuresPublicly(input, output) - ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ScanOutputTransform(config, input); - History.ScanOutputTransform := History.ScanOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - {Operations.QueryInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method QueryInputTransform ( input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryInputTransformEnsuresPublicly(input, output) - ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.QueryInputTransform(config, input); - History.QueryInputTransform := History.QueryInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - {Operations.QueryOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method QueryOutputTransform ( input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryOutputTransformEnsuresPublicly(input, output) - ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.QueryOutputTransform(config, input); - History.QueryOutputTransform := History.QueryOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - {Operations.TransactWriteItemsInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactWriteItemsInputTransform(config, input); - History.TransactWriteItemsInputTransform := History.TransactWriteItemsInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - {Operations.TransactWriteItemsOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactWriteItemsOutputTransform(config, input); - History.TransactWriteItemsOutputTransform := History.TransactWriteItemsOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - {Operations.UpdateItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemInputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.UpdateItemInputTransform(config, input); - History.UpdateItemInputTransform := History.UpdateItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - {Operations.UpdateItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.UpdateItemOutputTransform(config, input); - History.UpdateItemOutputTransform := History.UpdateItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - {Operations.DeleteItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemInputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.DeleteItemInputTransform(config, input); - History.DeleteItemInputTransform := History.DeleteItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - {Operations.DeleteItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.DeleteItemOutputTransform(config, input); - History.DeleteItemOutputTransform := History.DeleteItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - {Operations.TransactGetItemsInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactGetItemsInputTransform(config, input); - History.TransactGetItemsInputTransform := History.TransactGetItemsInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - {Operations.TransactGetItemsOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactGetItemsOutputTransform(config, input); - History.TransactGetItemsOutputTransform := History.TransactGetItemsOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - {Operations.ExecuteStatementInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteStatementInputTransform(config, input); - History.ExecuteStatementInputTransform := History.ExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - {Operations.ExecuteStatementOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteStatementOutputTransform(config, input); - History.ExecuteStatementOutputTransform := History.ExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - {Operations.BatchExecuteStatementInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchExecuteStatementInputTransform(config, input); - History.BatchExecuteStatementInputTransform := History.BatchExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - {Operations.BatchExecuteStatementOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchExecuteStatementOutputTransform(config, input); - History.BatchExecuteStatementOutputTransform := History.BatchExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - {Operations.ExecuteTransactionInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteTransactionInputTransform(config, input); - History.ExecuteTransactionInputTransform := History.ExecuteTransactionInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - {Operations.ExecuteTransactionOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteTransactionOutputTransform(config, input); - History.ExecuteTransactionOutputTransform := History.ExecuteTransactionOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - {Operations.ResolveAttributesEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ResolveAttributes ( input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ResolveAttributes - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ResolveAttributesEnsuresPublicly(input, output) - ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] - { - output := Operations.ResolveAttributes(config, input); - History.ResolveAttributes := History.ResolveAttributes + [DafnyCallEvent(input, output)]; -} - -} -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method PutItemInputTransform ( config: InternalConfig , input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures PutItemInputTransformEnsuresPublicly(input, output) - - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method PutItemOutputTransform ( config: InternalConfig , input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures PutItemOutputTransformEnsuresPublicly(input, output) - - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method GetItemInputTransform ( config: InternalConfig , input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures GetItemInputTransformEnsuresPublicly(input, output) - - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method GetItemOutputTransform ( config: InternalConfig , input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures GetItemOutputTransformEnsuresPublicly(input, output) - - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method BatchWriteItemInputTransform ( config: InternalConfig , input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method BatchWriteItemOutputTransform ( config: InternalConfig , input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method PutItemInputTransform ( config: InternalConfig , input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures PutItemInputTransformEnsuresPublicly(input, output) + + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method PutItemOutputTransform ( config: InternalConfig , input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures PutItemOutputTransformEnsuresPublicly(input, output) + + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method GetItemInputTransform ( config: InternalConfig , input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures GetItemInputTransformEnsuresPublicly(input, output) + + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method GetItemOutputTransform ( config: InternalConfig , input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures GetItemOutputTransformEnsuresPublicly(input, output) + + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method BatchWriteItemInputTransform ( config: InternalConfig , input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method BatchWriteItemOutputTransform ( config: InternalConfig , input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchGetItemInputTransform ( config: InternalConfig , input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + method BatchGetItemInputTransform ( config: InternalConfig , input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchGetItemOutputTransform ( config: InternalConfig , input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + method BatchGetItemOutputTransform ( config: InternalConfig , input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ScanInputTransform ( config: InternalConfig , input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ScanInputTransformEnsuresPublicly(input, output) + method ScanInputTransform ( config: InternalConfig , input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ScanInputTransformEnsuresPublicly(input, output) - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ScanOutputTransform ( config: InternalConfig , input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ScanOutputTransformEnsuresPublicly(input, output) + method ScanOutputTransform ( config: InternalConfig , input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ScanOutputTransformEnsuresPublicly(input, output) - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + // The private method to be refined by the library developer - method QueryInputTransform ( config: InternalConfig , input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures QueryInputTransformEnsuresPublicly(input, output) + method QueryInputTransform ( config: InternalConfig , input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures QueryInputTransformEnsuresPublicly(input, output) - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method QueryOutputTransform ( config: InternalConfig , input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures QueryOutputTransformEnsuresPublicly(input, output) + method QueryOutputTransform ( config: InternalConfig , input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures QueryOutputTransformEnsuresPublicly(input, output) - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactWriteItemsInputTransform ( config: InternalConfig , input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + method TransactWriteItemsInputTransform ( config: InternalConfig , input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactWriteItemsOutputTransform ( config: InternalConfig , input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + method TransactWriteItemsOutputTransform ( config: InternalConfig , input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method UpdateItemInputTransform ( config: InternalConfig , input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures UpdateItemInputTransformEnsuresPublicly(input, output) + method UpdateItemInputTransform ( config: InternalConfig , input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures UpdateItemInputTransformEnsuresPublicly(input, output) - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method UpdateItemOutputTransform ( config: InternalConfig , input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + method UpdateItemOutputTransform ( config: InternalConfig , input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method DeleteItemInputTransform ( config: InternalConfig , input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DeleteItemInputTransformEnsuresPublicly(input, output) + method DeleteItemInputTransform ( config: InternalConfig , input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DeleteItemInputTransformEnsuresPublicly(input, output) - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method DeleteItemOutputTransform ( config: InternalConfig , input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + method DeleteItemOutputTransform ( config: InternalConfig , input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactGetItemsInputTransform ( config: InternalConfig , input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + method TransactGetItemsInputTransform ( config: InternalConfig , input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactGetItemsOutputTransform ( config: InternalConfig , input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + method TransactGetItemsOutputTransform ( config: InternalConfig , input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteStatementInputTransform ( config: InternalConfig , input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - + method ExecuteStatementInputTransform ( config: InternalConfig , input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteStatementOutputTransform ( config: InternalConfig , input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - + method ExecuteStatementOutputTransform ( config: InternalConfig , input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchExecuteStatementInputTransform ( config: InternalConfig , input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - + method BatchExecuteStatementInputTransform ( config: InternalConfig , input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchExecuteStatementOutputTransform ( config: InternalConfig , input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - + method BatchExecuteStatementOutputTransform ( config: InternalConfig , input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteTransactionInputTransform ( config: InternalConfig , input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - + method ExecuteTransactionInputTransform ( config: InternalConfig , input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteTransactionOutputTransform ( config: InternalConfig , input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - + method ExecuteTransactionOutputTransform ( config: InternalConfig , input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - // The private method to be refined by the library developer + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + // The private method to be refined by the library developer - method ResolveAttributes ( config: InternalConfig , input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ResolveAttributesEnsuresPublicly(input, output) + method ResolveAttributes ( config: InternalConfig , input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ResolveAttributesEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy index 62a76dd86..9cf150af2 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy @@ -102,7 +102,7 @@ module } method {:vcs_split_on_every_assert} DynamoDbEncryptionTransforms(config: AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig) - returns (res: Result) + returns (res: Result) //= specification/dynamodb-encryption-client/ddb-table-encryption-config.md#logical-table-name //= type=implication //# When mapping [DynamoDB Table Names](#dynamodb-table-name) to [logical table name](#logical-table-name) diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy index 22e6c6737..5dd26cd15 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy @@ -2,303 +2,310 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../DynamoDbEncryption/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkDynamoDbTypes - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyPrimitivesTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype DecryptItemInput = | DecryptItemInput ( - nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap - ) - datatype DecryptItemOutput = | DecryptItemOutput ( - nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly parsedHeader: Option - ) - class IDynamoDbItemEncryptorClientCallHistory { - ghost constructor() { - EncryptItem := []; - DecryptItem := []; -} - ghost var EncryptItem: seq>> - ghost var DecryptItem: seq>> -} - trait {:termination false} IDynamoDbItemEncryptorClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../DynamoDbEncryption/src/Index.dfy" +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkDynamoDbTypes + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyPrimitivesTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbItemEncryptorClientCallHistory - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - // The public method to be called by library consumers - method EncryptItem ( input: EncryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`EncryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures EncryptItemEnsuresPublicly(input, output) - ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] - - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - // The public method to be called by library consumers - method DecryptItem ( input: DecryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DecryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DecryptItemEnsuresPublicly(input, output) - ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] - -} - datatype DynamoDbItemEncryptorConfig = | DynamoDbItemEncryptorConfig ( - nameonly logicalTableName: string , - nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , - nameonly sortKeyName: Option , - nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , - nameonly allowedUnsignedAttributes: Option , - nameonly allowedUnsignedAttributePrefix: Option , - nameonly algorithmSuiteId: Option , - nameonly keyring: Option , - nameonly cmm: Option , - nameonly legacyOverride: Option , - nameonly plaintextOverride: Option - ) - datatype EncryptItemInput = | EncryptItemInput ( - nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap - ) - datatype EncryptItemOutput = | EncryptItemOutput ( - nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly parsedHeader: Option - ) - datatype ParsedHeader = | ParsedHeader ( - nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , - nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , - nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , - nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext - ) - datatype Error = - // Local Error structures are listed here - | DynamoDbItemEncryptorException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations - function method DefaultDynamoDbItemEncryptorConfig(): DynamoDbItemEncryptorConfig - method DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig := DefaultDynamoDbItemEncryptorConfig()) - returns (res: Result) - requires config.keyring.Some? ==> - config.keyring.value.ValidState() - requires config.cmm.Some? ==> - config.cmm.value.ValidState() - requires config.legacyOverride.Some? ==> - config.legacyOverride.value.encryptor.ValidState() - modifies if config.keyring.Some? then - config.keyring.value.Modifies - else {} - modifies if config.cmm.Some? then - config.cmm.value.Modifies - else {} - modifies if config.legacyOverride.Some? then - config.legacyOverride.value.encryptor.Modifies - else {} - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies - - ( if config.keyring.Some? then - config.keyring.value.Modifies - else {} - ) - ( if config.cmm.Some? then - config.cmm.value.Modifies - else {} - ) - ( if config.legacyOverride.Some? then - config.legacyOverride.value.encryptor.Modifies - else {} - ) ) - && fresh(res.value.History) - && res.value.ValidState() - ensures config.keyring.Some? ==> - config.keyring.value.ValidState() - ensures config.cmm.Some? ==> - config.cmm.value.ValidState() - ensures config.legacyOverride.Some? ==> - config.legacyOverride.value.encryptor.ValidState() + // Begin Generated Types - class DynamoDbItemEncryptorClient extends IDynamoDbItemEncryptorClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - {Operations.EncryptItemEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method EncryptItem ( input: EncryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`EncryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures EncryptItemEnsuresPublicly(input, output) - ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] - { - output := Operations.EncryptItem(config, input); - History.EncryptItem := History.EncryptItem + [DafnyCallEvent(input, output)]; -} - - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - {Operations.DecryptItemEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DecryptItem ( input: DecryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DecryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DecryptItemEnsuresPublicly(input, output) - ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] - { - output := Operations.DecryptItem(config, input); - History.DecryptItem := History.DecryptItem + [DafnyCallEvent(input, output)]; -} - + datatype DecryptItemInput = | DecryptItemInput ( + nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap + ) + datatype DecryptItemOutput = | DecryptItemOutput ( + nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly parsedHeader: Option := Option.None + ) + class IDynamoDbItemEncryptorClientCallHistory { + ghost constructor() { + EncryptItem := []; + DecryptItem := []; + } + ghost var EncryptItem: seq>> + ghost var DecryptItem: seq>> + } + trait {:termination false} IDynamoDbItemEncryptorClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbItemEncryptorClientCallHistory + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + // The public method to be called by library consumers + method EncryptItem ( input: EncryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`EncryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures EncryptItemEnsuresPublicly(input, output) + ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] + + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + // The public method to be called by library consumers + method DecryptItem ( input: DecryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DecryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DecryptItemEnsuresPublicly(input, output) + ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] + + } + datatype DynamoDbItemEncryptorConfig = | DynamoDbItemEncryptorConfig ( + nameonly logicalTableName: string , + nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , + nameonly sortKeyName: Option := Option.None , + nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , + nameonly allowedUnsignedAttributes: Option := Option.None , + nameonly allowedUnsignedAttributePrefix: Option := Option.None , + nameonly algorithmSuiteId: Option := Option.None , + nameonly keyring: Option := Option.None , + nameonly cmm: Option := Option.None , + nameonly legacyOverride: Option := Option.None , + nameonly plaintextOverride: Option := Option.None + ) + datatype EncryptItemInput = | EncryptItemInput ( + nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap + ) + datatype EncryptItemOutput = | EncryptItemOutput ( + nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly parsedHeader: Option := Option.None + ) + datatype ParsedHeader = | ParsedHeader ( + nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , + nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , + nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , + nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext + ) + datatype Error = + // Local Error structures are listed here + | DynamoDbItemEncryptorException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations + function method DefaultDynamoDbItemEncryptorConfig(): DynamoDbItemEncryptorConfig + method DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig := DefaultDynamoDbItemEncryptorConfig()) + returns (res: Result) + requires config.keyring.Some? ==> + config.keyring.value.ValidState() + requires config.cmm.Some? ==> + config.cmm.value.ValidState() + requires config.legacyOverride.Some? ==> + config.legacyOverride.value.encryptor.ValidState() + modifies if config.keyring.Some? then + config.keyring.value.Modifies + else {} + modifies if config.cmm.Some? then + config.cmm.value.Modifies + else {} + modifies if config.legacyOverride.Some? then + config.legacyOverride.value.encryptor.Modifies + else {} + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies + - ( if config.keyring.Some? then + config.keyring.value.Modifies + else {} + ) - ( if config.cmm.Some? then + config.cmm.value.Modifies + else {} + ) - ( if config.legacyOverride.Some? then + config.legacyOverride.value.encryptor.Modifies + else {} + ) ) + && fresh(res.value.History) + && res.value.ValidState() + ensures config.keyring.Some? ==> + config.keyring.value.ValidState() + ensures config.cmm.Some? ==> + config.cmm.value.ValidState() + ensures config.legacyOverride.Some? ==> + config.legacyOverride.value.encryptor.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbItemEncryptorClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbItemEncryptorClient extends IDynamoDbItemEncryptorClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + {Operations.EncryptItemEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method EncryptItem ( input: EncryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`EncryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures EncryptItemEnsuresPublicly(input, output) + ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] + { + output := Operations.EncryptItem(config, input); + History.EncryptItem := History.EncryptItem + [DafnyCallEvent(input, output)]; + } + + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + {Operations.DecryptItemEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DecryptItem ( input: DecryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DecryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DecryptItemEnsuresPublicly(input, output) + ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] + { + output := Operations.DecryptItem(config, input); + History.DecryptItem := History.DecryptItem + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + // The private method to be refined by the library developer - method EncryptItem ( config: InternalConfig , input: EncryptItemInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures EncryptItemEnsuresPublicly(input, output) + method EncryptItem ( config: InternalConfig , input: EncryptItemInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures EncryptItemEnsuresPublicly(input, output) - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - // The private method to be refined by the library developer + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + // The private method to be refined by the library developer - method DecryptItem ( config: InternalConfig , input: DecryptItemInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DecryptItemEnsuresPublicly(input, output) + method DecryptItem ( config: InternalConfig , input: DecryptItemInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DecryptItemEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy index 9f88ab83e..c19f4d252 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy @@ -45,7 +45,7 @@ module } method {:vcs_split_on_every_assert} DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig) - returns (res: Result) + returns (res: Result) ensures res.Success? ==> && res.value.config.logicalTableName == config.logicalTableName && res.value.config.partitionKeyName == config.partitionKeyName diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy index ec84abffa..dac8dc194 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy @@ -2,337 +2,344 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types" } AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyPrimitivesTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype AuthenticateAction = - | SIGN - | DO_NOT_SIGN - datatype AuthenticateSchema = | AuthenticateSchema ( - nameonly content: AuthenticateSchemaContent , - nameonly attributes: Option - ) - type AuthenticateSchemaAttributes = map - datatype AuthenticateSchemaContent = - | Action(Action: AuthenticateAction) - | SchemaMap(SchemaMap: AuthenticateSchemaMap) - | SchemaList(SchemaList: AuthenticateSchemaList) - type AuthenticateSchemaList = seq - type AuthenticateSchemaMap = map - datatype CryptoAction = - | ENCRYPT_AND_SIGN - | SIGN_ONLY - | DO_NOTHING - datatype CryptoSchema = | CryptoSchema ( - nameonly content: CryptoSchemaContent , - nameonly attributes: Option - ) - type CryptoSchemaAttributes = map - datatype CryptoSchemaContent = - | Action(Action: CryptoAction) - | SchemaMap(SchemaMap: CryptoSchemaMap) - | SchemaList(SchemaList: CryptoSchemaList) - type CryptoSchemaList = seq - type CryptoSchemaMap = map - datatype DecryptStructureInput = | DecryptStructureInput ( - nameonly tableName: string , - nameonly encryptedStructure: StructuredData , - nameonly authenticateSchema: AuthenticateSchema , - nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , - nameonly encryptionContext: Option - ) - datatype DecryptStructureOutput = | DecryptStructureOutput ( - nameonly plaintextStructure: StructuredData , - nameonly parsedHeader: ParsedHeader - ) - datatype EncryptStructureInput = | EncryptStructureInput ( - nameonly tableName: string , - nameonly plaintextStructure: StructuredData , - nameonly cryptoSchema: CryptoSchema , - nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , - nameonly algorithmSuiteId: Option , - nameonly encryptionContext: Option - ) - datatype EncryptStructureOutput = | EncryptStructureOutput ( - nameonly encryptedStructure: StructuredData , - nameonly parsedHeader: ParsedHeader - ) - datatype ParsedHeader = | ParsedHeader ( - nameonly cryptoSchema: CryptoSchema , - nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , - nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , - nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext - ) - datatype StructuredData = | StructuredData ( - nameonly content: StructuredDataContent , - nameonly attributes: Option - ) - type StructuredDataAttributes = map - datatype StructuredDataContent = - | Terminal(Terminal: StructuredDataTerminal) - | DataList(DataList: StructuredDataList) - | DataMap(DataMap: StructuredDataMap) - type StructuredDataList = seq - type StructuredDataMap = map - datatype StructuredDataTerminal = | StructuredDataTerminal ( - nameonly value: TerminalValue , - nameonly typeId: TerminalTypeId - ) - class IStructuredEncryptionClientCallHistory { - ghost constructor() { - EncryptStructure := []; - DecryptStructure := []; -} - ghost var EncryptStructure: seq>> - ghost var DecryptStructure: seq>> -} - trait {:termination false} IStructuredEncryptionClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types" } AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyPrimitivesTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IStructuredEncryptionClientCallHistory - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - // The public method to be called by library consumers - method EncryptStructure ( input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`EncryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures EncryptStructureEnsuresPublicly(input, output) - ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] - - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - // The public method to be called by library consumers - method DecryptStructure ( input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`DecryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures DecryptStructureEnsuresPublicly(input, output) - ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] - -} - datatype StructuredEncryptionConfig = | StructuredEncryptionConfig ( - - ) - type TerminalTypeId = x: seq | IsValid_TerminalTypeId(x) witness * - predicate method IsValid_TerminalTypeId(x: seq) { - ( 2 <= |x| <= 2 ) -} - type TerminalValue = seq - type Version = x: int32 | IsValid_Version(x) witness * - predicate method IsValid_Version(x: int32) { - ( 1 <= x <= 1 ) -} - datatype Error = - // Local Error structures are listed here - | StructuredEncryptionException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations - function method DefaultStructuredEncryptionConfig(): StructuredEncryptionConfig - method StructuredEncryption(config: StructuredEncryptionConfig := DefaultStructuredEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() + // Begin Generated Types - class StructuredEncryptionClient extends IStructuredEncryptionClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - {Operations.EncryptStructureEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method EncryptStructure ( input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`EncryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures EncryptStructureEnsuresPublicly(input, output) - ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] - { - output := Operations.EncryptStructure(config, input); - History.EncryptStructure := History.EncryptStructure + [DafnyCallEvent(input, output)]; -} - - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - {Operations.DecryptStructureEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DecryptStructure ( input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`DecryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures DecryptStructureEnsuresPublicly(input, output) - ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] - { - output := Operations.DecryptStructure(config, input); - History.DecryptStructure := History.DecryptStructure + [DafnyCallEvent(input, output)]; -} - + datatype AuthenticateAction = + | SIGN + | DO_NOT_SIGN + datatype AuthenticateSchema = | AuthenticateSchema ( + nameonly content: AuthenticateSchemaContent , + nameonly attributes: Option := Option.None + ) + type AuthenticateSchemaAttributes = map + datatype AuthenticateSchemaContent = + | Action(Action: AuthenticateAction) + | SchemaMap(SchemaMap: AuthenticateSchemaMap) + | SchemaList(SchemaList: AuthenticateSchemaList) + type AuthenticateSchemaList = seq + type AuthenticateSchemaMap = map + datatype CryptoAction = + | ENCRYPT_AND_SIGN + | SIGN_ONLY + | DO_NOTHING + datatype CryptoSchema = | CryptoSchema ( + nameonly content: CryptoSchemaContent , + nameonly attributes: Option := Option.None + ) + type CryptoSchemaAttributes = map + datatype CryptoSchemaContent = + | Action(Action: CryptoAction) + | SchemaMap(SchemaMap: CryptoSchemaMap) + | SchemaList(SchemaList: CryptoSchemaList) + type CryptoSchemaList = seq + type CryptoSchemaMap = map + datatype DecryptStructureInput = | DecryptStructureInput ( + nameonly tableName: string , + nameonly encryptedStructure: StructuredData , + nameonly authenticateSchema: AuthenticateSchema , + nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , + nameonly encryptionContext: Option := Option.None + ) + datatype DecryptStructureOutput = | DecryptStructureOutput ( + nameonly plaintextStructure: StructuredData , + nameonly parsedHeader: ParsedHeader + ) + datatype EncryptStructureInput = | EncryptStructureInput ( + nameonly tableName: string , + nameonly plaintextStructure: StructuredData , + nameonly cryptoSchema: CryptoSchema , + nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , + nameonly algorithmSuiteId: Option := Option.None , + nameonly encryptionContext: Option := Option.None + ) + datatype EncryptStructureOutput = | EncryptStructureOutput ( + nameonly encryptedStructure: StructuredData , + nameonly parsedHeader: ParsedHeader + ) + datatype ParsedHeader = | ParsedHeader ( + nameonly cryptoSchema: CryptoSchema , + nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , + nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , + nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext + ) + datatype StructuredData = | StructuredData ( + nameonly content: StructuredDataContent , + nameonly attributes: Option := Option.None + ) + type StructuredDataAttributes = map + datatype StructuredDataContent = + | Terminal(Terminal: StructuredDataTerminal) + | DataList(DataList: StructuredDataList) + | DataMap(DataMap: StructuredDataMap) + type StructuredDataList = seq + type StructuredDataMap = map + datatype StructuredDataTerminal = | StructuredDataTerminal ( + nameonly value: TerminalValue , + nameonly typeId: TerminalTypeId + ) + class IStructuredEncryptionClientCallHistory { + ghost constructor() { + EncryptStructure := []; + DecryptStructure := []; + } + ghost var EncryptStructure: seq>> + ghost var DecryptStructure: seq>> + } + trait {:termination false} IStructuredEncryptionClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IStructuredEncryptionClientCallHistory + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + // The public method to be called by library consumers + method EncryptStructure ( input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`EncryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures EncryptStructureEnsuresPublicly(input, output) + ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] + + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + // The public method to be called by library consumers + method DecryptStructure ( input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`DecryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures DecryptStructureEnsuresPublicly(input, output) + ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] + + } + datatype StructuredEncryptionConfig = | StructuredEncryptionConfig ( + + ) + type TerminalTypeId = x: seq | IsValid_TerminalTypeId(x) witness * + predicate method IsValid_TerminalTypeId(x: seq) { + ( 2 <= |x| <= 2 ) + } + type TerminalValue = seq + type Version = x: int32 | IsValid_Version(x) witness * + predicate method IsValid_Version(x: int32) { + ( 1 <= x <= 1 ) + } + datatype Error = + // Local Error structures are listed here + | StructuredEncryptionException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations + function method DefaultStructuredEncryptionConfig(): StructuredEncryptionConfig + method StructuredEncryption(config: StructuredEncryptionConfig := DefaultStructuredEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IStructuredEncryptionClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class StructuredEncryptionClient extends IStructuredEncryptionClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + {Operations.EncryptStructureEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method EncryptStructure ( input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`EncryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures EncryptStructureEnsuresPublicly(input, output) + ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] + { + output := Operations.EncryptStructure(config, input); + History.EncryptStructure := History.EncryptStructure + [DafnyCallEvent(input, output)]; + } + + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + {Operations.DecryptStructureEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DecryptStructure ( input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`DecryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures DecryptStructureEnsuresPublicly(input, output) + ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] + { + output := Operations.DecryptStructure(config, input); + History.DecryptStructure := History.DecryptStructure + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + // The private method to be refined by the library developer - method EncryptStructure ( config: InternalConfig , input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.cmm.ValidState() - modifies ModifiesInternalConfig(config) , - input.cmm.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.cmm.Modifies - ensures - && ValidInternalConfig?(config) - ensures EncryptStructureEnsuresPublicly(input, output) + method EncryptStructure ( config: InternalConfig , input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.cmm.ValidState() + modifies ModifiesInternalConfig(config) , + input.cmm.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.cmm.Modifies + ensures + && ValidInternalConfig?(config) + ensures EncryptStructureEnsuresPublicly(input, output) - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - // The private method to be refined by the library developer + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + // The private method to be refined by the library developer - method DecryptStructure ( config: InternalConfig , input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.cmm.ValidState() - modifies ModifiesInternalConfig(config) , - input.cmm.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.cmm.Modifies - ensures - && ValidInternalConfig?(config) - ensures DecryptStructureEnsuresPublicly(input, output) + method DecryptStructure ( config: InternalConfig , input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.cmm.ValidState() + modifies ModifiesInternalConfig(config) , + input.cmm.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.cmm.Modifies + ensures + && ValidInternalConfig?(config) + ensures DecryptStructureEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy index 9f0f9df97..5700a2b9e 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy @@ -18,7 +18,7 @@ module } method StructuredEncryption(config: StructuredEncryptionConfig) - returns (res: Result) + returns (res: Result) { var maybePrimitives := Primitives.AtomicPrimitives(); var primitives :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); From 890dd5cf95e1aa7dd6580237fb407b4f33c5db09 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 15:01:04 -0800 Subject: [PATCH 03/40] More client type fixes --- ...tionSdkDynamoDbItemEncryptorOperations.dfy | 2 +- .../dafny/DynamoDbItemEncryptor/src/Index.dfy | 19 ++++++----- ...phyDbEncryptionSdkDynamoDbTypesWrapped.dfy | 30 ++++++++-------- ...tographyDynamoDbEncryptionTypesWrapped.dfy | 34 +++++++++---------- 4 files changed, 44 insertions(+), 41 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy index 5ea299388..5f28ea398 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy @@ -40,7 +40,7 @@ module AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations refines Abs nameonly allowedUnsignedAttributes: Option, nameonly allowedUnsignedAttributePrefix: Option, nameonly algorithmSuiteId: Option, - nameonly structuredEncryption: StructuredEncryption.StructuredEncryptionClient, + nameonly structuredEncryption: StructuredEncryption.Types.IStructuredEncryptionClient, nameonly plaintextOverride: DDBE.PlaintextOverride, nameonly internalLegacyOverride: Option := None ) diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy index c19f4d252..837b94584 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy @@ -47,13 +47,15 @@ module method {:vcs_split_on_every_assert} DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig) returns (res: Result) ensures res.Success? ==> - && res.value.config.logicalTableName == config.logicalTableName - && res.value.config.partitionKeyName == config.partitionKeyName - && res.value.config.sortKeyName == config.sortKeyName - && res.value.config.attributeActionsOnEncrypt == config.attributeActionsOnEncrypt - && res.value.config.allowedUnsignedAttributes == config.allowedUnsignedAttributes - && res.value.config.allowedUnsignedAttributePrefix == config.allowedUnsignedAttributePrefix - && res.value.config.algorithmSuiteId == config.algorithmSuiteId + && res.value is DynamoDbItemEncryptorClient + && var client := res.value as DynamoDbItemEncryptorClient; + && client.config.logicalTableName == config.logicalTableName + && client.config.partitionKeyName == config.partitionKeyName + && client.config.sortKeyName == config.sortKeyName + && client.config.attributeActionsOnEncrypt == config.attributeActionsOnEncrypt + && client.config.allowedUnsignedAttributes == config.allowedUnsignedAttributes + && client.config.allowedUnsignedAttributePrefix == config.allowedUnsignedAttributePrefix + && client.config.algorithmSuiteId == config.algorithmSuiteId //= specification/dynamodb-encryption-client/ddb-table-encryption-config.md#attribute-actions //= type=implication @@ -71,7 +73,8 @@ module && res.Success? && config.plaintextOverride.None? ==> - res.value.config.plaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ? + && var client := res.value as DynamoDbItemEncryptorClient; + && client.config.plaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ? { :- Need(config.keyring.None? || config.cmm.None?, DynamoDbItemEncryptorException( message := "Cannot provide both a keyring and a CMM" diff --git a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypesWrapped.dfy b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypesWrapped.dfy index 02010514e..32493877f 100644 --- a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypesWrapped.dfy +++ b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypesWrapped.dfy @@ -2,19 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../src/Index.dfy" - abstract module WrappedAbstractAwsCryptographyDbEncryptionSdkDynamoDbService { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - import WrappedService : AbstractAwsCryptographyDbEncryptionSdkDynamoDbService - function method WrappedDefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig - method {:extern} WrappedDynamoDbEncryption(config: DynamoDbEncryptionConfig := WrappedDefaultDynamoDbEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() +include "../src/Index.dfy" +abstract module WrappedAbstractAwsCryptographyDbEncryptionSdkDynamoDbService { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + import WrappedService : AbstractAwsCryptographyDbEncryptionSdkDynamoDbService + function method WrappedDefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig + method {:extern} WrappedDynamoDbEncryption(config: DynamoDbEncryptionConfig := WrappedDefaultDynamoDbEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() } diff --git a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy index 2c48c4f48..2aff57584 100644 --- a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy +++ b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy @@ -2,22 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - // BEGIN MANUAL EDIT - include "../../../../DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/KeyVectors/src/Index.dfy" +// BEGIN MANUAL EDIT +include "../../../../DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/KeyVectors/src/Index.dfy" // END MANUAL EDIT - abstract module WrappedAbstractAwsCryptographyDynamoDbEncryptionService { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - import WrappedService : AbstractAwsCryptographyDbEncryptionSdkDynamoDbService - function method WrappedDefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig - method {:extern} WrappedDynamoDbEncryption(config: DynamoDbEncryptionConfig := WrappedDefaultDynamoDbEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() +abstract module WrappedAbstractAwsCryptographyDynamoDbEncryptionService { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + import WrappedService : AbstractAwsCryptographyDbEncryptionSdkDynamoDbService + function method WrappedDefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig + method {:extern} WrappedDynamoDbEncryption(config: DynamoDbEncryptionConfig := WrappedDefaultDynamoDbEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() } From f3e651f41d3f72dd81f28088db5f515f3f0e1a4b Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 15:05:50 -0800 Subject: [PATCH 04/40] Regenerate .net --- .../DynamoDbEncryption/TypeConversion.cs | 13 +- .../TypeConversion.cs | 21 +- .../DynamoDbItemEncryptor/TypeConversion.cs | 32 +- .../StructuredEncryption/TypeConversion.cs | 23 +- .../runtimes/net/Extern/CreateClient.cs | 44 +- .../DDBEncryption/DynamoDbEncryptionShim.cs | 54 + .../Generated/DDBEncryption/TypeConversion.cs | 1378 +++++++++++++++++ ...eWrapper_DynamoDbKeyBranchKeyIdSupplier.cs | 49 + ...edNativeWrapper_LegacyDynamoDbEncryptor.cs | 22 + .../runtimes/net/src/TestVectorsMain.cs | 2 +- 10 files changed, 1589 insertions(+), 49 deletions(-) create mode 100644 TestVectors/runtimes/net/Generated/DDBEncryption/DynamoDbEncryptionShim.cs create mode 100644 TestVectors/runtimes/net/Generated/DDBEncryption/TypeConversion.cs create mode 100644 TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier.cs create mode 100644 TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_LegacyDynamoDbEncryptor.cs diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs index addc17eb9..5c0cee33e 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs @@ -1141,7 +1141,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -1357,6 +1362,10 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph { switch (value) { + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption + ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders @@ -1365,10 +1374,6 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyPrimitives ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( dafnyVal._ComAmazonawsDynamodb diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs index 931a421df..24b8c0b94 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs @@ -4053,7 +4053,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -6487,6 +6492,14 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption + ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders @@ -6495,14 +6508,6 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( dafnyVal._ComAmazonawsDynamodb ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption - ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_DynamoDbEncryptionTransformsException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N10_transforms__S37_DynamoDbEncryptionTransformsException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_CollectionOfErrors dafnyVal: diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs index bdb119725..211981fb6 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs @@ -741,7 +741,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -900,32 +905,37 @@ public static System.IO.MemoryStream FromDafny_N6_smithy__N3_api__S4_Blob(Dafny. } public static Dafny.ISequence ToDafny_N6_smithy__N3_api__S4_Blob(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Exception FromDafny_CommonError(software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types._IError value) { switch (value) { - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: - return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyPrimitives + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDb dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: + return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyPrimitives + ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( dafnyVal._ComAmazonawsDynamodb ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDb dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb - ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_DynamoDbItemEncryptorException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N13_itemEncryptor__S30_DynamoDbItemEncryptorException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_CollectionOfErrors dafnyVal: diff --git a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs index b22c7304f..800a4e547 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs @@ -797,7 +797,12 @@ public static System.IO.MemoryStream FromDafny_N3_aws__N12_cryptography__N15_dbE } public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S13_TerminalValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.IO.MemoryStream FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S14_TerminalTypeId(Dafny.ISequence value) { @@ -805,7 +810,12 @@ public static System.IO.MemoryStream FromDafny_N3_aws__N12_cryptography__N15_dbE } public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S14_TerminalTypeId(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S24_StructuredDataAttributes__M3_key(Dafny.ISequence value) { @@ -904,20 +914,25 @@ public static System.IO.MemoryStream FromDafny_N6_smithy__N3_api__S4_Blob(Dafny. } public static Dafny.ISequence ToDafny_N6_smithy__N3_api__S4_Blob(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Exception FromDafny_CommonError(software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types._IError value) { switch (value) { - case software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: - return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyPrimitives - ); case software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders ); + case software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: + return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyPrimitives + ); case software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error_StructuredEncryptionException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S29_StructuredEncryptionException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error_CollectionOfErrors dafnyVal: diff --git a/TestVectors/runtimes/net/Extern/CreateClient.cs b/TestVectors/runtimes/net/Extern/CreateClient.cs index b32d0b606..573d0bdc8 100644 --- a/TestVectors/runtimes/net/Extern/CreateClient.cs +++ b/TestVectors/runtimes/net/Extern/CreateClient.cs @@ -3,30 +3,32 @@ using Wrappers_Compile; using _IError = software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError; -namespace CreateInterceptedDDBClient_Compile { +namespace CreateInterceptedDDBClient_Compile +{ - public partial class __default { - public static _IResult CreateInterceptedDDBClient(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IDynamoDbTablesEncryptionConfig config) + public partial class __default { - var clientConfig = new AmazonDynamoDBConfig(); - clientConfig.ServiceURL = "http://localhost:8000"; - - var native = AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms.TypeConversion - .FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_DynamoDbTablesEncryptionConfig( - config); + public static _IResult CreateInterceptedDDBClient(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IDynamoDbTablesEncryptionConfig config) + { + var clientConfig = new AmazonDynamoDBConfig(); + clientConfig.ServiceURL = "http://localhost:8000"; - var client = new Client.DynamoDbClient(clientConfig, native); - var c2 = new Com.Amazonaws.Dynamodb.DynamoDBv2Shim(client); - return new Result_Success(c2); - } - public static _IResult CreateVanillaDDBClient() - { - var clientConfig = new AmazonDynamoDBConfig(); - clientConfig.ServiceURL = "http://localhost:8000"; - var client = new AmazonDynamoDBClient(clientConfig); - var c2 = new Com.Amazonaws.Dynamodb.DynamoDBv2Shim(client); - return new Result_Success(c2); + var native = AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms.TypeConversion + .FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_DynamoDbTablesEncryptionConfig( + config); + + var client = new Client.DynamoDbClient(clientConfig, native); + var c2 = new Com.Amazonaws.Dynamodb.DynamoDBv2Shim(client); + return new Result_Success(c2); + } + public static _IResult CreateVanillaDDBClient() + { + var clientConfig = new AmazonDynamoDBConfig(); + clientConfig.ServiceURL = "http://localhost:8000"; + var client = new AmazonDynamoDBClient(clientConfig); + var c2 = new Com.Amazonaws.Dynamodb.DynamoDBv2Shim(client); + return new Result_Success(c2); + } } - } } diff --git a/TestVectors/runtimes/net/Generated/DDBEncryption/DynamoDbEncryptionShim.cs b/TestVectors/runtimes/net/Generated/DDBEncryption/DynamoDbEncryptionShim.cs new file mode 100644 index 000000000..245587c6b --- /dev/null +++ b/TestVectors/runtimes/net/Generated/DDBEncryption/DynamoDbEncryptionShim.cs @@ -0,0 +1,54 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Wrapped +{ + public class DynamoDbEncryptionShim : software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbEncryptionClient + { + public AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryption _impl; + public DynamoDbEncryptionShim(AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryption impl) + { + this._impl = impl; + } + public Wrappers_Compile._IResult CreateDynamoDbEncryptionBranchKeyIdSupplier(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ICreateDynamoDbEncryptionBranchKeyIdSupplierInput request) + { + AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierInput unWrappedRequest = TypeConversion.FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput(request); try + { + AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput wrappedResponse = + this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(unWrappedRequest); + return Wrappers_Compile.Result.create_Success(TypeConversion.ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(wrappedResponse)); + } + catch (System.Exception ex) + { + return Wrappers_Compile.Result.create_Failure(this.ConvertError(ex)); + } + + } + private software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError ConvertError(System.Exception error) + { + + switch (error) + { + case AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionException e: + return TypeConversion.ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(e); + + case CollectionOfErrors collectionOfErrors: + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_CollectionOfErrors( + Dafny.Sequence + .FromArray( + collectionOfErrors.list.Select + (x => TypeConversion.ToDafny_CommonError(x)) + .ToArray()), + Dafny.Sequence.FromString(collectionOfErrors.Message) + ); + default: + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_Opaque(error); + + } + } + } +} diff --git a/TestVectors/runtimes/net/Generated/DDBEncryption/TypeConversion.cs b/TestVectors/runtimes/net/Generated/DDBEncryption/TypeConversion.cs new file mode 100644 index 000000000..2097da0c7 --- /dev/null +++ b/TestVectors/runtimes/net/Generated/DDBEncryption/TypeConversion.cs @@ -0,0 +1,1378 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System.Linq; +using System; +namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Wrapped +{ + public static class TypeConversion + { + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconKeySource value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource)value; + var converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource(); if (value.is_single) + { + converted.Single = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M6_single(concrete.dtor_single); + return converted; + } + if (value.is_multi) + { + converted.Multi = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M5_multi(concrete.dtor_multi); + return converted; + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource state"); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconKeySource ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource(AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource value) + { + if (value.IsSetSingle()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource.create_single(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M6_single(value.Single)); + } + if (value.IsSetMulti()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource.create_multi(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M5_multi(value.Multi)); + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource state"); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconStyle FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconStyle value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle)value; + var converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconStyle(); if (value.is_partOnly) + { + converted.PartOnly = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M8_partOnly(concrete.dtor_partOnly); + return converted; + } + if (value.is_shared) + { + converted.Shared = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M6_shared(concrete.dtor_shared); + return converted; + } + if (value.is_asSet) + { + converted.AsSet = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M5_asSet(concrete.dtor_asSet); + return converted; + } + if (value.is_sharedSet) + { + converted.SharedSet = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M9_sharedSet(concrete.dtor_sharedSet); + return converted; + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconStyle state"); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconStyle ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle(AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconStyle value) + { + if (value.IsSetPartOnly()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle.create_partOnly(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M8_partOnly(value.PartOnly)); + } + if (value.IsSetShared()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle.create_shared(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M6_shared(value.Shared)); + } + if (value.IsSetAsSet()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle.create_asSet(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M5_asSet(value.AsSet)); + } + if (value.IsSetSharedSet()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle.create_sharedSet(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M9_sharedSet(value.SharedSet)); + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconStyle state"); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierInput FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ICreateDynamoDbEncryptionBranchKeyIdSupplierInput value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierInput converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(); converted.DdbKeyBranchKeyIdSupplier = (AWS.Cryptography.DbEncryptionSDK.DynamoDb.IDynamoDbKeyBranchKeyIdSupplier)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput__M25_ddbKeyBranchKeyIdSupplier(concrete._ddbKeyBranchKeyIdSupplier); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ICreateDynamoDbEncryptionBranchKeyIdSupplierInput ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierInput value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput__M25_ddbKeyBranchKeyIdSupplier(value.DdbKeyBranchKeyIdSupplier)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ICreateDynamoDbEncryptionBranchKeyIdSupplierOutput value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(); converted.BranchKeyIdSupplier = (AWS.Cryptography.MaterialProviders.IBranchKeyIdSupplier)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput__M19_branchKeyIdSupplier(concrete._branchKeyIdSupplier); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ICreateDynamoDbEncryptionBranchKeyIdSupplierOutput ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput__M19_branchKeyIdSupplier(value.BranchKeyIdSupplier)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionConfig FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S24_DynamoDbEncryptionConfig(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IDynamoDbEncryptionConfig value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionConfig converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionConfig(); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IDynamoDbEncryptionConfig ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S24_DynamoDbEncryptionConfig(AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionConfig value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig(); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionException FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_DynamoDbEncryptionException value) + { + return new AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionException( + FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException__M7_message(value._message) + ); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_DynamoDbEncryptionException ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionException value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_DynamoDbEncryptionException( + ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException__M7_message(value.Message) + ); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput(); converted.DdbKey = (System.Collections.Generic.Dictionary)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput__M6_ddbKey(concrete._ddbKey); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput__M6_ddbKey(value.DdbKey)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput(); converted.BranchKeyId = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput__M11_branchKeyId(concrete._branchKeyId); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput__M11_branchKeyId(value.BranchKeyId)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_LegacyPolicy(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILegacyPolicy value) + { + if (value.is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT; + if (value.is_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT; + if (value.is_FORBID__LEGACY__ENCRYPT__FORBID__LEGACY__DECRYPT) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT; + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy value"); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILegacyPolicy ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_LegacyPolicy(AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy value) + { + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy.create_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy.FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__FORBID__LEGACY__DECRYPT(); + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.LegacyPolicy value"); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_PlaintextOverride(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPlaintextOverride value) + { + if (value.is_FORCE__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ; + if (value.is_FORBID__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ; + if (value.is_FORBID__PLAINTEXT__WRITE__FORBID__PLAINTEXT__READ) return AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ; + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride value"); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPlaintextOverride ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_PlaintextOverride(AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride value) + { + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride.create_FORCE__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); + if (AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ.Equals(value)) return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__FORBID__PLAINTEXT__READ(); + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.PlaintextOverride value"); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.VirtualTransform FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IVirtualTransform value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform)value; + var converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.VirtualTransform(); if (value.is_upper) + { + converted.Upper = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_upper(concrete.dtor_upper); + return converted; + } + if (value.is_lower) + { + converted.Lower = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_lower(concrete.dtor_lower); + return converted; + } + if (value.is_insert) + { + converted.Insert = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_insert(concrete.dtor_insert); + return converted; + } + if (value.is_prefix) + { + converted.Prefix = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_prefix(concrete.dtor_prefix); + return converted; + } + if (value.is_suffix) + { + converted.Suffix = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_suffix(concrete.dtor_suffix); + return converted; + } + if (value.is_substring) + { + converted.Substring = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M9_substring(concrete.dtor_substring); + return converted; + } + if (value.is_segment) + { + converted.Segment = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M7_segment(concrete.dtor_segment); + return converted; + } + if (value.is_segments) + { + converted.Segments = FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M8_segments(concrete.dtor_segments); + return converted; + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.VirtualTransform state"); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IVirtualTransform ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform(AWS.Cryptography.DbEncryptionSDK.DynamoDb.VirtualTransform value) + { + if (value.IsSetUpper()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_upper(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_upper(value.Upper)); + } + if (value.IsSetLower()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_lower(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_lower(value.Lower)); + } + if (value.IsSetInsert()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_insert(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_insert(value.Insert)); + } + if (value.IsSetPrefix()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_prefix(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_prefix(value.Prefix)); + } + if (value.IsSetSuffix()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_suffix(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_suffix(value.Suffix)); + } + if (value.IsSetSubstring()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_substring(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M9_substring(value.Substring)); + } + if (value.IsSetSegment()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_segment(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M7_segment(value.Segment)); + } + if (value.IsSetSegments()) + { + return software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform.create_segments(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M8_segments(value.Segments)); + } + throw new System.ArgumentException("Invalid AWS.Cryptography.DbEncryptionSDK.DynamoDb.VirtualTransform state"); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M6_single(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISingleKeyStore value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISingleKeyStore ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M6_single(AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M5_multi(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IMultiKeyStore value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IMultiKeyStore ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource__M5_multi(AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M8_partOnly(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPartOnly value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S8_PartOnly(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPartOnly ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M8_partOnly(AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S8_PartOnly(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M6_shared(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IShared value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IShared ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M6_shared(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M5_asSet(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IAsSet value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_AsSet(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IAsSet ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M5_asSet(AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_AsSet(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M9_sharedSet(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISharedSet value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISharedSet ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_BeaconStyle__M9_sharedSet(AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.IDynamoDbKeyBranchKeyIdSupplier FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput__M25_ddbKeyBranchKeyIdSupplier(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S39_DynamoDbKeyBranchKeyIdSupplierReference(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S48_CreateDynamoDbEncryptionBranchKeyIdSupplierInput__M25_ddbKeyBranchKeyIdSupplier(AWS.Cryptography.DbEncryptionSDK.DynamoDb.IDynamoDbKeyBranchKeyIdSupplier value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S39_DynamoDbKeyBranchKeyIdSupplierReference(value); + } + public static AWS.Cryptography.MaterialProviders.IBranchKeyIdSupplier FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput__M19_branchKeyIdSupplier(software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S49_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput__M19_branchKeyIdSupplier(AWS.Cryptography.MaterialProviders.IBranchKeyIdSupplier value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException__M7_message(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException__M7_message(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static System.Collections.Generic.Dictionary FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput__M6_ddbKey(Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key(value); + } + public static Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput__M6_ddbKey(System.Collections.Generic.Dictionary value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput__M11_branchKeyId(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput__M11_branchKeyId(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_upper(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IUpper value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Upper(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IUpper ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_upper(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Upper(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_lower(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILower value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Lower(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILower ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M5_lower(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Lower(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_insert(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IInsert value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IInsert ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_insert(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_prefix(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetPrefix value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetPrefix ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_prefix(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_suffix(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSuffix value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSuffix ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M6_suffix(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M9_substring(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSubstring value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSubstring ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M9_substring(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M7_segment(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegment value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegment ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M7_segment(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M8_segments(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegments value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments(value); + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegments ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S16_VirtualTransform__M8_segments(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments(value); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISingleKeyStore value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SingleKeyStore concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SingleKeyStore)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore(); converted.KeyId = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M5_keyId(concrete._keyId); + converted.CacheTTL = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M8_cacheTTL(concrete._cacheTTL); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISingleKeyStore ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore(AWS.Cryptography.DbEncryptionSDK.DynamoDb.SingleKeyStore value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SingleKeyStore(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M5_keyId(value.KeyId), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M8_cacheTTL(value.CacheTTL)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IMultiKeyStore value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.MultiKeyStore concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.MultiKeyStore)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore(); converted.KeyFieldName = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M12_keyFieldName(concrete._keyFieldName); + converted.CacheTTL = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M8_cacheTTL(concrete._cacheTTL); + if (concrete._cache.is_Some) converted.Cache = (AWS.Cryptography.MaterialProviders.CacheType)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M5_cache(concrete._cache); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IMultiKeyStore ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore(AWS.Cryptography.DbEncryptionSDK.DynamoDb.MultiKeyStore value) + { + AWS.Cryptography.MaterialProviders.CacheType var_cache = value.IsSetCache() ? value.Cache : (AWS.Cryptography.MaterialProviders.CacheType)null; + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.MultiKeyStore(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M12_keyFieldName(value.KeyFieldName), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M8_cacheTTL(value.CacheTTL), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M5_cache(var_cache)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S8_PartOnly(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPartOnly value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PartOnly concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PartOnly)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly(); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IPartOnly ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S8_PartOnly(AWS.Cryptography.DbEncryptionSDK.DynamoDb.PartOnly value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PartOnly(); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IShared value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Shared concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Shared)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared(); converted.Other = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared__M5_other(concrete._other); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IShared ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Shared value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Shared(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared__M5_other(value.Other)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_AsSet(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IAsSet value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.AsSet concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.AsSet)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet(); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IAsSet ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_AsSet(AWS.Cryptography.DbEncryptionSDK.DynamoDb.AsSet value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.AsSet(); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISharedSet value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SharedSet concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SharedSet)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet(); converted.Other = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet__M5_other(concrete._other); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ISharedSet ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet(AWS.Cryptography.DbEncryptionSDK.DynamoDb.SharedSet value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SharedSet(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet__M5_other(value.Other)); + } + internal static AWS.Cryptography.DbEncryptionSDK.DynamoDb.IDynamoDbKeyBranchKeyIdSupplier FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S39_DynamoDbKeyBranchKeyIdSupplierReference(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier value) + { + // This is converting a reference type in a dependant module. + // Therefore it defers to the dependant module for conversion + return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S39_DynamoDbKeyBranchKeyIdSupplierReference(value); + } + internal static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S39_DynamoDbKeyBranchKeyIdSupplierReference(AWS.Cryptography.DbEncryptionSDK.DynamoDb.IDynamoDbKeyBranchKeyIdSupplier value) + { + // This is converting a reference type in a dependant module. + // Therefore it defers to the dependant module for conversion + return new WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier((DynamoDbKeyBranchKeyIdSupplierBase)value); + } + public static AWS.Cryptography.MaterialProviders.IBranchKeyIdSupplier FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier value) + { + // This is converting a reference type in a dependant module. + // Therefore it defers to the dependant module for conversion + return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(AWS.Cryptography.MaterialProviders.IBranchKeyIdSupplier value) + { + // This is converting a reference type in a dependant module. + // Therefore it defers to the dependant module for conversion + return AWS.Cryptography.MaterialProviders.TypeConversion.ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S28_BranchKeyIdSupplierReference(value); + } + public static string FromDafny_N6_smithy__N3_api__S6_String(Dafny.ISequence value) + { + return new string(value.Elements); + } + public static Dafny.ISequence ToDafny_N6_smithy__N3_api__S6_String(string value) + { + return Dafny.Sequence.FromString(value); + } + public static System.Collections.Generic.Dictionary FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key(Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> value) + { + return value.ItemEnumerable.ToDictionary(pair => FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M3_key(pair.Car), pair => FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M5_value(pair.Cdr)); + } + public static Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key(System.Collections.Generic.Dictionary value) + { + return Dafny.Map, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue>.FromCollection(value.Select(pair => + new Dafny.Pair, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue>(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M3_key(pair.Key), ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M5_value(pair.Value)) + )); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Upper(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IUpper value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Upper concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Upper)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper(); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IUpper ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Upper(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Upper value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Upper(); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Lower(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILower value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Lower concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Lower)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower(); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._ILower ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S5_Lower(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Lower value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Lower(); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IInsert value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Insert concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Insert)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert(); converted.Literal = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert__M7_literal(concrete._literal); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IInsert ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert(AWS.Cryptography.DbEncryptionSDK.DynamoDb.Insert value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Insert(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert__M7_literal(value.Literal)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetPrefix value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetPrefix concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetPrefix)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix(); converted.Length = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix__M6_length(concrete._length); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetPrefix ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetPrefix value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetPrefix(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix__M6_length(value.Length)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSuffix value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSuffix concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSuffix)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix(); converted.Length = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix__M6_length(concrete._length); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSuffix ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSuffix value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSuffix(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix__M6_length(value.Length)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSubstring value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSubstring concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSubstring)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring(); converted.Low = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M3_low(concrete._low); + converted.High = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M4_high(concrete._high); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSubstring ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSubstring value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSubstring(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M3_low(value.Low), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M4_high(value.High)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegment value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegment concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegment)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment(); converted.Split = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_split(concrete._split); + converted.Index = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_index(concrete._index); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegment ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegment value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegment(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_split(value.Split), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_index(value.Index)); + } + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegments value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegments concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegments)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments(); converted.Split = (string)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M5_split(concrete._split); + converted.Low = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M3_low(concrete._low); + converted.High = (int)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M4_high(concrete._high); return converted; + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetSegments ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetSegments value) + { + + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegments(ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M5_split(value.Split), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M3_low(value.Low), ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M4_high(value.High)); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M5_keyId(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M5_keyId(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M8_cacheTTL(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S14_SingleKeyStore__M8_cacheTTL(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M12_keyFieldName(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M12_keyFieldName(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M8_cacheTTL(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M8_cacheTTL(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static AWS.Cryptography.MaterialProviders.CacheType FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M5_cache(Wrappers_Compile._IOption value) + { + return value.is_None ? (AWS.Cryptography.MaterialProviders.CacheType)null : FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType(value.Extract()); + } + public static Wrappers_Compile._IOption ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S13_MultiKeyStore__M5_cache(AWS.Cryptography.MaterialProviders.CacheType value) + { + return value == null ? Wrappers_Compile.Option.create_None() : Wrappers_Compile.Option.create_Some(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType((AWS.Cryptography.MaterialProviders.CacheType)value)); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared__M5_other(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Shared__M5_other(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet__M5_other(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_SharedSet__M5_other(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M3_key(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M3_key(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(value); + } + public static Amazon.DynamoDBv2.Model.AttributeValue FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M5_value(software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S3_Key__M5_value(Amazon.DynamoDBv2.Model.AttributeValue value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert__M7_literal(Dafny.ISequence value) + { + return FromDafny_N6_smithy__N3_api__S6_String(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S6_Insert__M7_literal(string value) + { + return ToDafny_N6_smithy__N3_api__S6_String(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix__M6_length(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetPrefix__M6_length(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix__M6_length(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S9_GetSuffix__M6_length(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M3_low(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M3_low(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M4_high(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S12_GetSubstring__M4_high(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_split(Dafny.ISequence value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_split(string value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_index(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S10_GetSegment__M5_index(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M5_split(Dafny.ISequence value) + { + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(value); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M5_split(string value) + { + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M3_low(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M3_low(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M4_high(int value) + { + return FromDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S11_GetSegments__M4_high(int value) + { + return ToDafny_N6_smithy__N3_api__S7_Integer(value); + } + public static int FromDafny_N6_smithy__N3_api__S7_Integer(int value) + { + return value; + } + public static int ToDafny_N6_smithy__N3_api__S7_Integer(int value) + { + return value; + } + public static AWS.Cryptography.MaterialProviders.CacheType FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType(software.amazon.cryptography.materialproviders.internaldafny.types._ICacheType value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.CacheType concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.CacheType)value; + var converted = new AWS.Cryptography.MaterialProviders.CacheType(); if (value.is_Default) + { + converted.Default = FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M7_Default(concrete.dtor_Default); + return converted; + } + if (value.is_No) + { + converted.No = FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M2_No(concrete.dtor_No); + return converted; + } + if (value.is_SingleThreaded) + { + converted.SingleThreaded = FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M14_SingleThreaded(concrete.dtor_SingleThreaded); + return converted; + } + if (value.is_MultiThreaded) + { + converted.MultiThreaded = FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_MultiThreaded(concrete.dtor_MultiThreaded); + return converted; + } + if (value.is_StormTracking) + { + converted.StormTracking = FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_StormTracking(concrete.dtor_StormTracking); + return converted; + } + throw new System.ArgumentException("Invalid AWS.Cryptography.MaterialProviders.CacheType state"); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._ICacheType ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType(AWS.Cryptography.MaterialProviders.CacheType value) + { + if (value.IsSetDefault()) + { + return software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.create_Default(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M7_Default(value.Default)); + } + if (value.IsSetNo()) + { + return software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.create_No(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M2_No(value.No)); + } + if (value.IsSetSingleThreaded()) + { + return software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.create_SingleThreaded(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M14_SingleThreaded(value.SingleThreaded)); + } + if (value.IsSetMultiThreaded()) + { + return software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.create_MultiThreaded(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_MultiThreaded(value.MultiThreaded)); + } + if (value.IsSetStormTracking()) + { + return software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.create_StormTracking(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_StormTracking(value.StormTracking)); + } + throw new System.ArgumentException("Invalid AWS.Cryptography.MaterialProviders.CacheType state"); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(Dafny.ISequence value) + { + return new string(value.Elements); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(string value) + { + return Dafny.Sequence.FromString(value); + } + public static Amazon.DynamoDBv2.Model.AttributeValue FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue value) + { + software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue concrete = (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)value; + var converted = new Amazon.DynamoDBv2.Model.AttributeValue(); if (value.is_S) + { + converted.S = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_S(concrete.dtor_S); + return converted; + } + if (value.is_N) + { + converted.N = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_N(concrete.dtor_N); + return converted; + } + if (value.is_B) + { + converted.B = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_B(concrete.dtor_B); + return converted; + } + if (value.is_SS) + { + converted.SS = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_SS(concrete.dtor_SS); + return converted; + } + if (value.is_NS) + { + converted.NS = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_NS(concrete.dtor_NS); + return converted; + } + if (value.is_BS) + { + converted.BS = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_BS(concrete.dtor_BS); + return converted; + } + if (value.is_M) + { + converted.M = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_M(concrete.dtor_M); + return converted; + } + if (value.is_L) + { + converted.L = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_L(concrete.dtor_L); + return converted; + } + if (value.is_NULL) + { + converted.NULL = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_NULL(concrete.dtor_NULL); + return converted; + } + if (value.is_BOOL) + { + converted.BOOL = FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_BOOL(concrete.dtor_BOOL); + return converted; + } + throw new System.ArgumentException("Invalid Amazon.DynamoDBv2.Model.AttributeValue state"); + } + public static software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(Amazon.DynamoDBv2.Model.AttributeValue value) + { + if (value.S != null) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_S(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_S(value.S)); + } + if (value.N != null) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_N(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_N(value.N)); + } + if (value.B != null) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_B(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_B(value.B)); + } + if (value.SS.Any()) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_SS(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_SS(value.SS)); + } + if (value.NS.Any()) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_NS(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_NS(value.NS)); + } + if (value.BS.Any()) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_BS(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_BS(value.BS)); + } + if (value.IsMSet) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_M(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_M(value.M)); + } + if (value.IsLSet) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_L(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_L(value.L)); + } + if (value.NULL == true) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_NULL(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_NULL(value.NULL)); + } + if (value.IsBOOLSet) + { + return software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_BOOL(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_BOOL(value.BOOL)); + } + throw new System.ArgumentException("Invalid Amazon.DynamoDBv2.Model.AttributeValue state"); + } + public static string FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(Dafny.ISequence value) + { + return new string(value.Elements); + } + public static Dafny.ISequence ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S4_Char(string value) + { + return Dafny.Sequence.FromString(value); + } + public static AWS.Cryptography.MaterialProviders.DefaultCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M7_Default(software.amazon.cryptography.materialproviders.internaldafny.types._IDefaultCache value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IDefaultCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M7_Default(AWS.Cryptography.MaterialProviders.DefaultCache value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache(value); + } + public static AWS.Cryptography.MaterialProviders.NoCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M2_No(software.amazon.cryptography.materialproviders.internaldafny.types._INoCache value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S7_NoCache(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._INoCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M2_No(AWS.Cryptography.MaterialProviders.NoCache value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S7_NoCache(value); + } + public static AWS.Cryptography.MaterialProviders.SingleThreadedCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M14_SingleThreaded(software.amazon.cryptography.materialproviders.internaldafny.types._ISingleThreadedCache value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._ISingleThreadedCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M14_SingleThreaded(AWS.Cryptography.MaterialProviders.SingleThreadedCache value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache(value); + } + public static AWS.Cryptography.MaterialProviders.MultiThreadedCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_MultiThreaded(software.amazon.cryptography.materialproviders.internaldafny.types._IMultiThreadedCache value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IMultiThreadedCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_MultiThreaded(AWS.Cryptography.MaterialProviders.MultiThreadedCache value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache(value); + } + public static AWS.Cryptography.MaterialProviders.StormTrackingCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_StormTracking(software.amazon.cryptography.materialproviders.internaldafny.types._IStormTrackingCache value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache(value); + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IStormTrackingCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S9_CacheType__M13_StormTracking(AWS.Cryptography.MaterialProviders.StormTrackingCache value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_S(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_S(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_N(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_N(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(value); + } + public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_B(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_B(System.IO.MemoryStream value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(value); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_SS(Dafny.ISequence> value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(value); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_SS(System.Collections.Generic.List value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(value); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_NS(Dafny.ISequence> value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue(value); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_NS(System.Collections.Generic.List value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue(value); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_BS(Dafny.ISequence> value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue(value); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M2_BS(System.Collections.Generic.List value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue(value); + } + public static System.Collections.Generic.Dictionary FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_M(Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue(value); + } + public static Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_M(System.Collections.Generic.Dictionary value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue(value); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_L(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M1_L(System.Collections.Generic.List value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue(value); + } + public static bool FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_NULL(bool value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_NullAttributeValue(value); + } + public static bool ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_NULL(bool value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_NullAttributeValue(value); + } + public static bool FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_BOOL(bool value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S21_BooleanAttributeValue(value); + } + public static bool ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue__M4_BOOL(bool value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S21_BooleanAttributeValue(value); + } + public static AWS.Cryptography.MaterialProviders.DefaultCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache(software.amazon.cryptography.materialproviders.internaldafny.types._IDefaultCache value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache)value; AWS.Cryptography.MaterialProviders.DefaultCache converted = new AWS.Cryptography.MaterialProviders.DefaultCache(); converted.EntryCapacity = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache__M13_entryCapacity(concrete._entryCapacity); return converted; + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IDefaultCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache(AWS.Cryptography.MaterialProviders.DefaultCache value) + { + + return new software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache__M13_entryCapacity(value.EntryCapacity)); + } + public static AWS.Cryptography.MaterialProviders.NoCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S7_NoCache(software.amazon.cryptography.materialproviders.internaldafny.types._INoCache value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.NoCache concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.NoCache)value; AWS.Cryptography.MaterialProviders.NoCache converted = new AWS.Cryptography.MaterialProviders.NoCache(); return converted; + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._INoCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S7_NoCache(AWS.Cryptography.MaterialProviders.NoCache value) + { + + return new software.amazon.cryptography.materialproviders.internaldafny.types.NoCache(); + } + public static AWS.Cryptography.MaterialProviders.SingleThreadedCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache(software.amazon.cryptography.materialproviders.internaldafny.types._ISingleThreadedCache value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache)value; AWS.Cryptography.MaterialProviders.SingleThreadedCache converted = new AWS.Cryptography.MaterialProviders.SingleThreadedCache(); converted.EntryCapacity = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M13_entryCapacity(concrete._entryCapacity); + if (concrete._entryPruningTailSize.is_Some) converted.EntryPruningTailSize = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M20_entryPruningTailSize(concrete._entryPruningTailSize); return converted; + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._ISingleThreadedCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache(AWS.Cryptography.MaterialProviders.SingleThreadedCache value) + { + int? var_entryPruningTailSize = value.IsSetEntryPruningTailSize() ? value.EntryPruningTailSize : (int?)null; + return new software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M13_entryCapacity(value.EntryCapacity), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M20_entryPruningTailSize(var_entryPruningTailSize)); + } + public static AWS.Cryptography.MaterialProviders.MultiThreadedCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache(software.amazon.cryptography.materialproviders.internaldafny.types._IMultiThreadedCache value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache)value; AWS.Cryptography.MaterialProviders.MultiThreadedCache converted = new AWS.Cryptography.MaterialProviders.MultiThreadedCache(); converted.EntryCapacity = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M13_entryCapacity(concrete._entryCapacity); + if (concrete._entryPruningTailSize.is_Some) converted.EntryPruningTailSize = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M20_entryPruningTailSize(concrete._entryPruningTailSize); return converted; + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IMultiThreadedCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache(AWS.Cryptography.MaterialProviders.MultiThreadedCache value) + { + int? var_entryPruningTailSize = value.IsSetEntryPruningTailSize() ? value.EntryPruningTailSize : (int?)null; + return new software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M13_entryCapacity(value.EntryCapacity), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M20_entryPruningTailSize(var_entryPruningTailSize)); + } + public static AWS.Cryptography.MaterialProviders.StormTrackingCache FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache(software.amazon.cryptography.materialproviders.internaldafny.types._IStormTrackingCache value) + { + software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache concrete = (software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache)value; AWS.Cryptography.MaterialProviders.StormTrackingCache converted = new AWS.Cryptography.MaterialProviders.StormTrackingCache(); converted.EntryCapacity = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_entryCapacity(concrete._entryCapacity); + if (concrete._entryPruningTailSize.is_Some) converted.EntryPruningTailSize = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M20_entryPruningTailSize(concrete._entryPruningTailSize); + converted.GracePeriod = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_gracePeriod(concrete._gracePeriod); + converted.GraceInterval = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_graceInterval(concrete._graceInterval); + converted.FanOut = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M6_fanOut(concrete._fanOut); + converted.InFlightTTL = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_inFlightTTL(concrete._inFlightTTL); + converted.SleepMilli = (int)FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M10_sleepMilli(concrete._sleepMilli); return converted; + } + public static software.amazon.cryptography.materialproviders.internaldafny.types._IStormTrackingCache ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache(AWS.Cryptography.MaterialProviders.StormTrackingCache value) + { + int? var_entryPruningTailSize = value.IsSetEntryPruningTailSize() ? value.EntryPruningTailSize : (int?)null; + return new software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_entryCapacity(value.EntryCapacity), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M20_entryPruningTailSize(var_entryPruningTailSize), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_gracePeriod(value.GracePeriod), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_graceInterval(value.GraceInterval), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M6_fanOut(value.FanOut), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_inFlightTTL(value.InFlightTTL), ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M10_sleepMilli(value.SleepMilli)); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(Dafny.ISequence value) + { + return new string(value.Elements); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(string value) + { + return Dafny.Sequence.FromString(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(Dafny.ISequence value) + { + return new string(value.Elements); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(string value) + { + return Dafny.Sequence.FromString(value); + } + public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(Dafny.ISequence value) + { + return new System.IO.MemoryStream(value.Elements); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) + { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } + return Dafny.Sequence.FromArray(value.ToArray()); + + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) + { + return new System.Collections.Generic.List(value.Elements.Select(FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue__M6_member)); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(System.Collections.Generic.List value) + { + return Dafny.Sequence>.FromArray(value.Select(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue__M6_member).ToArray()); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue(Dafny.ISequence> value) + { + return new System.Collections.Generic.List(value.Elements.Select(FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue__M6_member)); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue(System.Collections.Generic.List value) + { + return Dafny.Sequence>.FromArray(value.Select(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue__M6_member).ToArray()); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue(Dafny.ISequence> value) + { + return new System.Collections.Generic.List(value.Elements.Select(FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue__M6_member)); + } + public static Dafny.ISequence> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue(System.Collections.Generic.List value) + { + return Dafny.Sequence>.FromArray(value.Select(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue__M6_member).ToArray()); + } + public static System.Collections.Generic.Dictionary FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue(Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> value) + { + return value.ItemEnumerable.ToDictionary(pair => FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M3_key(pair.Car), pair => FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M5_value(pair.Cdr)); + } + public static Dafny.IMap, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue> ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue(System.Collections.Generic.Dictionary value) + { + return Dafny.Map, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue>.FromCollection(value.Select(pair => + new Dafny.Pair, software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue>(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M3_key(pair.Key), ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M5_value(pair.Value)) + )); + } + public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue(Dafny.ISequence value) + { + return new System.Collections.Generic.List(value.Elements.Select(FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue__M6_member)); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue(System.Collections.Generic.List value) + { + return Dafny.Sequence.FromArray(value.Select(ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue__M6_member).ToArray()); + } + public static bool FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_NullAttributeValue(bool value) + { + return value; + } + public static bool ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_NullAttributeValue(bool value) + { + return value; + } + public static bool FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S21_BooleanAttributeValue(bool value) + { + return value; + } + public static bool ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S21_BooleanAttributeValue(bool value) + { + return value; + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache__M13_entryCapacity(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S12_DefaultCache__M13_entryCapacity(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M13_entryCapacity(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M13_entryCapacity(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int? FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M20_entryPruningTailSize(Wrappers_Compile._IOption value) + { + return value.is_None ? (int?)null : FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value.Extract()); + } + public static Wrappers_Compile._IOption ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S19_SingleThreadedCache__M20_entryPruningTailSize(int? value) + { + return value == null ? Wrappers_Compile.Option.create_None() : Wrappers_Compile.Option.create_Some(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber((int)value)); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M13_entryCapacity(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M13_entryCapacity(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int? FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M20_entryPruningTailSize(Wrappers_Compile._IOption value) + { + return value.is_None ? (int?)null : FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value.Extract()); + } + public static Wrappers_Compile._IOption ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_MultiThreadedCache__M20_entryPruningTailSize(int? value) + { + return value == null ? Wrappers_Compile.Option.create_None() : Wrappers_Compile.Option.create_Some(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber((int)value)); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_entryCapacity(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_entryCapacity(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int? FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M20_entryPruningTailSize(Wrappers_Compile._IOption value) + { + return value.is_None ? (int?)null : FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value.Extract()); + } + public static Wrappers_Compile._IOption ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M20_entryPruningTailSize(int? value) + { + return value == null ? Wrappers_Compile.Option.create_None() : Wrappers_Compile.Option.create_Some(ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber((int)value)); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_gracePeriod(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_gracePeriod(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_graceInterval(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M13_graceInterval(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M6_fanOut(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M6_fanOut(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_inFlightTTL(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M11_inFlightTTL(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M10_sleepMilli(int value) + { + return FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S18_StormTrackingCache__M10_sleepMilli(int value) + { + return ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue__M6_member(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue__M6_member(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_StringAttributeValue(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue__M6_member(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_NumberSetAttributeValue__M6_member(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_NumberAttributeValue(value); + } + public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue__M6_member(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_BinarySetAttributeValue__M6_member(System.IO.MemoryStream value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(value); + } + public static string FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M3_key(Dafny.ISequence value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(value); + } + public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M3_key(string value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S13_AttributeName(value); + } + public static Amazon.DynamoDBv2.Model.AttributeValue FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M5_value(software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S17_MapAttributeValue__M5_value(Amazon.DynamoDBv2.Model.AttributeValue value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static Amazon.DynamoDBv2.Model.AttributeValue FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue__M6_member(software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue value) + { + return FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static software.amazon.cryptography.services.dynamodb.internaldafny.types._IAttributeValue ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S18_ListAttributeValue__M6_member(Amazon.DynamoDBv2.Model.AttributeValue value) + { + return ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S14_AttributeValue(value); + } + public static int FromDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(int value) + { + return value; + } + public static int ToDafny_N3_aws__N12_cryptography__N17_materialProviders__S14_CountingNumber(int value) + { + return value; + } + public static System.Exception FromDafny_CommonError(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError value) + { + switch (value) + { + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: + return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyMaterialProviders + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: + return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyPrimitives + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: + return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( + dafnyVal._ComAmazonawsDynamodb + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_DynamoDbEncryptionException dafnyVal: + return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(dafnyVal); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_CollectionOfErrors dafnyVal: + return new CollectionOfErrors( + new System.Collections.Generic.List(dafnyVal.dtor_list.CloneAsArray() + .Select(x => TypeConversion.FromDafny_CommonError(x))), + new string(dafnyVal.dtor_message.Elements)); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_Opaque dafnyVal: + return new OpaqueError(dafnyVal._obj); + default: + // The switch MUST be complete for _IError, so `value` MUST NOT be an _IError. (How did you get here?) + return new OpaqueError(); + } + } + public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError ToDafny_CommonError(System.Exception value) + { + + switch (value) + { + case AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbEncryptionException exception: + return ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(exception); + case CollectionOfErrors collectionOfErrors: + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_CollectionOfErrors( + Dafny.Sequence + .FromArray( + collectionOfErrors.list.Select + (x => TypeConversion.ToDafny_CommonError(x)) + .ToArray()), + Dafny.Sequence.FromString(collectionOfErrors.Message) + ); + // OpaqueError is redundant, but listed for completeness. + case OpaqueError exception: + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_Opaque(exception); + case System.Exception exception: + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_Opaque(exception); + default: + // The switch MUST be complete for System.Exception, so `value` MUST NOT be an System.Exception. (How did you get here?) + return new software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_Opaque(value); + } + } + } +} diff --git a/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier.cs b/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier.cs new file mode 100644 index 000000000..6a4671ffb --- /dev/null +++ b/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier.cs @@ -0,0 +1,49 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +// ReSharper disable RedundantUsingDirective +// ReSharper disable RedundantNameQualifier +// ReSharper disable SuggestVarOrType_SimpleTypes +using System; +using _System; +using Wrappers_Compile; + +namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Wrapped +{ + internal class WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier : software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier + { + internal readonly DynamoDbKeyBranchKeyIdSupplierBase _impl; + public WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier(DynamoDbKeyBranchKeyIdSupplierBase nativeImpl) + { + _impl = nativeImpl; + } + public Wrappers_Compile._IResult GetBranchKeyIdFromDdbKey(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput input) + { + void validateOutput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput nativeOutput) + { + try { nativeOutput.Validate(); } + catch (ArgumentException e) + { + var message = $"Output of {_impl}._GetBranchKeyIdFromDdbKey is invalid. {e.Message}"; + throw new DynamoDbEncryptionException(message); + } + } + AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput nativeInput = TypeConversion.FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput(input); + try + { + AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput nativeOutput = _impl.GetBranchKeyIdFromDdbKey(nativeInput); + _ = nativeOutput ?? throw new DynamoDbEncryptionException($"{_impl}._GetBranchKeyIdFromDdbKey returned null, should be {typeof(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput)}"); + validateOutput(nativeOutput); + return Wrappers_Compile.Result.create_Success(TypeConversion.ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput(nativeOutput)); + } + catch (Exception e) + { + return Wrappers_Compile.Result.create_Failure(TypeConversion.ToDafny_CommonError(e)); + } + } + public Wrappers_Compile._IResult GetBranchKeyIdFromDdbKey_k(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput input) + { + throw new DynamoDbEncryptionException("Not supported at this time."); + } + } +} diff --git a/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_LegacyDynamoDbEncryptor.cs b/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_LegacyDynamoDbEncryptor.cs new file mode 100644 index 000000000..5c2d4198a --- /dev/null +++ b/TestVectors/runtimes/net/Generated/DDBEncryption/WrappedNativeWrapper_LegacyDynamoDbEncryptor.cs @@ -0,0 +1,22 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +// ReSharper disable RedundantUsingDirective +// ReSharper disable RedundantNameQualifier +// ReSharper disable SuggestVarOrType_SimpleTypes +using System; +using _System; +using Wrappers_Compile; + +namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Wrapped +{ + internal class WrappedNativeWrapper_LegacyDynamoDbEncryptor : software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor + { + internal readonly LegacyDynamoDbEncryptorBase _impl; + public WrappedNativeWrapper_LegacyDynamoDbEncryptor(LegacyDynamoDbEncryptorBase nativeImpl) + { + _impl = nativeImpl; + } + + } +} diff --git a/TestVectors/runtimes/net/src/TestVectorsMain.cs b/TestVectors/runtimes/net/src/TestVectorsMain.cs index 6718d8877..1126929bd 100644 --- a/TestVectors/runtimes/net/src/TestVectorsMain.cs +++ b/TestVectors/runtimes/net/src/TestVectorsMain.cs @@ -5,6 +5,6 @@ class Program static void Main() { WrappedDDBEncryptionMain_Compile.__default.ASDF(); - } + } } } From ae27d8064393e890e08a6e2a281c074af1458c50 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 15:58:15 -0800 Subject: [PATCH 05/40] More client type fixes --- .github/workflows/ci_verification.yml | 1 + .../src/DdbMiddlewareConfig.dfy | 12 ++++++++++-- .../src/DynamoDbMiddlewareSupport.dfy | 15 ++++++++------- .../DynamoDbEncryptionTransforms/src/Index.dfy | 4 +++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_verification.yml b/.github/workflows/ci_verification.yml index 407f8dd2c..ede4965a1 100644 --- a/.github/workflows/ci_verification.yml +++ b/.github/workflows/ci_verification.yml @@ -28,6 +28,7 @@ jobs: # Don't run the nightly build on forks if: github.event_name != 'schedule' || github.repository_owner == 'aws' strategy: + fail-fast: false matrix: # Break up verification between namespaces over multiple # actions to take advantage of parallelization diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy index 4e116edb4..cde9f127c 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy @@ -6,21 +6,25 @@ module DdbMiddlewareConfig { import opened Wrappers import opened AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes import DynamoDbItemEncryptor + import ENC = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations import EncTypes = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes import DDBE = AwsCryptographyDbEncryptionSdkDynamoDbTypes import SearchableEncryptionInfo + import AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations datatype TableConfig = TableConfig( physicalTableName: ComAmazonawsDynamodbTypes.TableName, logicalTableName: string, partitionKeyName: string, sortKeyName: Option, - itemEncryptor: DynamoDbItemEncryptor.DynamoDbItemEncryptorClient, + itemEncryptor: DynamoDbItemEncryptor.Types.IDynamoDbItemEncryptorClient, search : Option ) predicate ValidTableConfig?(config: TableConfig) { - var encryptorConfig := config.itemEncryptor.config; + && config.itemEncryptor is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient + && var itemEncryptorClient := config.itemEncryptor as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; + && var encryptorConfig := itemEncryptorClient.config; && config.logicalTableName == encryptorConfig.logicalTableName && config.partitionKeyName == encryptorConfig.partitionKeyName && config.sortKeyName == encryptorConfig.sortKeyName @@ -30,6 +34,10 @@ module DdbMiddlewareConfig { type ValidTableConfig = c: TableConfig | ValidTableConfig?(c) witness * + function method ItemEncryptorClientConfig(config: ValidTableConfig): ENC.Config { + (config.itemEncryptor as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient).config + } + function OneSearchModifies(config : ValidTableConfig) : set { if config.search.Some? then config.search.value.Modifies() else {} diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DynamoDbMiddlewareSupport.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DynamoDbMiddlewareSupport.dfy index 8d2ce7e19..e0e185e3e 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DynamoDbMiddlewareSupport.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DynamoDbMiddlewareSupport.dfy @@ -49,7 +49,8 @@ module DynamoDbMiddlewareSupport { attr : string ) { - BS.IsSigned(config.itemEncryptor.config.attributeActionsOnEncrypt, attr) + var itemEncryptorClient := config.itemEncryptor as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; + BS.IsSigned(itemEncryptorClient.config.attributeActionsOnEncrypt, attr) } // TestConditionExpression fails if a condition expression is not suitable for the @@ -63,7 +64,7 @@ module DynamoDbMiddlewareSupport { ) : Result { - BS.TestConditionExpression(config.itemEncryptor.config.attributeActionsOnEncrypt, expr, attrNames, attrValues) + BS.TestConditionExpression(ItemEncryptorClientConfig(config).attributeActionsOnEncrypt, expr, attrNames, attrValues) .MapFailure(e => E(e)) } @@ -78,7 +79,7 @@ module DynamoDbMiddlewareSupport { ) : Result { - BS.TestUpdateExpression(config.itemEncryptor.config.attributeActionsOnEncrypt, expr, attrNames, attrValues) + BS.TestUpdateExpression(ItemEncryptorClientConfig(config).attributeActionsOnEncrypt, expr, attrNames, attrValues) .MapFailure(e => E(e)) } @@ -86,7 +87,7 @@ module DynamoDbMiddlewareSupport { // returning a replacement AttributeMap. method AddSignedBeacons(config : ValidTableConfig, item : DDB.AttributeMap) returns (output : Result) - requires AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.ValidInternalConfig?(config.itemEncryptor.config) + requires AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.ValidInternalConfig?(ItemEncryptorClientConfig(config)) requires OneSearchValidState(config) ensures OneSearchValidState(config) modifies OneSearchModifies(config) @@ -99,7 +100,7 @@ module DynamoDbMiddlewareSupport { // returning just the new items. method GetEncryptedBeacons(config : ValidTableConfig, item : DDB.AttributeMap, keyId : Util.MaybeKeyId) returns (output : Result) - requires AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.ValidInternalConfig?(config.itemEncryptor.config) + requires AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.ValidInternalConfig?(ItemEncryptorClientConfig(config)) requires OneSearchValidState(config) ensures OneSearchValidState(config) modifies OneSearchModifies(config) @@ -184,7 +185,7 @@ module DynamoDbMiddlewareSupport { ensures OneSearchValidState(config) modifies OneSearchModifies(config) { - var ret := BS.QueryInputForBeacons(config.search, config.itemEncryptor.config.attributeActionsOnEncrypt, req); + var ret := BS.QueryInputForBeacons(config.search, ItemEncryptorClientConfig(config).attributeActionsOnEncrypt, req); return ret.MapFailure(e => AwsCryptographyDbEncryptionSdkDynamoDb(e)); } @@ -208,7 +209,7 @@ module DynamoDbMiddlewareSupport { ensures OneSearchValidState(config) modifies OneSearchModifies(config) { - var ret := BS.ScanInputForBeacons(config.search, config.itemEncryptor.config.attributeActionsOnEncrypt, req); + var ret := BS.ScanInputForBeacons(config.search, ItemEncryptorClientConfig(config).attributeActionsOnEncrypt, req); return ret.MapFailure(e => AwsCryptographyDbEncryptionSdkDynamoDb(e)); } diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy index 9cf150af2..02b31d0f2 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy @@ -108,7 +108,9 @@ module //# When mapping [DynamoDB Table Names](#dynamodb-table-name) to [logical table name](#logical-table-name) //# there MUST a one to one mapping between the two. ensures res.Success? ==> - && DdbMiddlewareConfig.ValidConfig?(res.value.config) + && res.value is DynamoDbEncryptionTransformsClient + && var client := res.value as DynamoDbEncryptionTransformsClient; + && DdbMiddlewareConfig.ValidConfig?(client.config) { var internalConfigs: map := map[]; assert ValidWholeSearchConfig(config); From 8b94d1d195a9e6d988fcb6b7169d98b1f633b015 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:15:33 -0800 Subject: [PATCH 06/40] Verification fixes --- .../DynamoDbEncryptionTransforms/test/TestFixtures.dfy | 8 ++++++-- .../dafny/StructuredEncryption/test/HappyCaseTests.dfy | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy index 1ef80c06e..d1ed2cae6 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy @@ -125,7 +125,9 @@ module TestFixtures { legacyOverride := None(), plaintextOverride := None() ); - encryptor :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); + var iencryptor: IDynamoDbItemEncryptorClient :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); + expect iencryptor is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; + encryptor := iencryptor as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; } method GetDynamoDbItemEncryptor() @@ -211,7 +213,7 @@ module TestFixtures { ensures fresh(encryption.Modifies) { var keyring := GetKmsKeyring(); - encryption :- expect DynamoDbEncryptionTransforms.DynamoDbEncryptionTransforms( + var iencryption: IDynamoDbEncryptionTransformsClient :- expect DynamoDbEncryptionTransforms.DynamoDbEncryptionTransforms( DynamoDbTablesEncryptionConfig( tableEncryptionConfigs := map[ "foo" := DynamoDbTableEncryptionConfig( @@ -236,6 +238,8 @@ module TestFixtures { ] ) ); + expect iencryption is DynamoDbEncryptionTransforms.DynamoDbEncryptionTransformsClient; + encryption := iencryption as DynamoDbEncryptionTransforms.DynamoDbEncryptionTransformsClient; assume {:axiom} fresh(encryption.Modifies); } } diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/test/HappyCaseTests.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/test/HappyCaseTests.dfy index 45f4bdd26..7e3346a12 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/test/HappyCaseTests.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/test/HappyCaseTests.dfy @@ -64,6 +64,7 @@ module HappyCaseTests { expect decryptRes.Success?; var newResult := decryptRes.value.plaintextStructure.content; var testResult := StructuredDataTestFixtures.TEST_STRUCTURED_DATA.content; + expect newResult.DataMap?; expect newResult.DataMap == testResult.DataMap; //= specification/structured-encryption/decrypt-structure.md#construct-decrypted-structured-data From ce19eca06a00bbbd2f486fd1b6837af9c05b1259 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:30:51 -0800 Subject: [PATCH 07/40] Another fix --- TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy b/TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy index b2f92676d..6e613ce9e 100644 --- a/TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy +++ b/TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy @@ -327,8 +327,9 @@ module {:options "-functionSyntax:4"} JsonConfig { legacyOverride := legacyOverride, plaintextOverride := plaintextOverride ); - var enc :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); - return Success(enc); + var enc: ENC.IDynamoDbItemEncryptorClient :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); + expect enc is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; + return Success(enc as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient); } method GetOneTableConfig(name : string, data : JSON) returns (output : Result) From c13f980d89ffe646866abc067a854105c07fdae8 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:47:04 -0800 Subject: [PATCH 08/40] Regenerate Java --- .../dynamodb/DynamoDbEncryption.java | 42 +- .../DynamoDbKeyBranchKeyIdSupplier.java | 82 +- .../IDynamoDbKeyBranchKeyIdSupplier.java | 4 +- .../dynamodb/ILegacyDynamoDbEncryptor.java | 3 +- .../dynamodb/LegacyDynamoDbEncryptor.java | 43 +- .../dbencryptionsdk/dynamodb/ToDafny.java | 795 ++++++++++++----- .../dbencryptionsdk/dynamodb/ToNative.java | 623 ++++++++++---- .../itemencryptor/DynamoDbItemEncryptor.java | 41 +- .../dynamodb/itemencryptor/ToDafny.java | 240 ++++-- .../dynamodb/itemencryptor/ToNative.java | 193 ++++- .../model/CollectionOfErrors.java | 5 +- .../itemencryptor/model/DecryptItemInput.java | 11 +- .../model/DecryptItemOutput.java | 11 +- .../model/DynamoDbItemEncryptorConfig.java | 92 +- .../model/DynamoDbItemEncryptorException.java | 11 +- .../itemencryptor/model/EncryptItemInput.java | 11 +- .../model/EncryptItemOutput.java | 11 +- .../itemencryptor/model/OpaqueError.java | 9 +- .../itemencryptor/model/ParsedHeader.java | 45 +- .../dbencryptionsdk/dynamodb/model/AsSet.java | 11 +- .../dynamodb/model/BeaconKeySource.java | 11 +- .../dynamodb/model/BeaconStyle.java | 16 +- .../dynamodb/model/BeaconVersion.java | 74 +- .../dynamodb/model/CollectionOfErrors.java | 5 +- .../dynamodb/model/CompoundBeacon.java | 41 +- .../dynamodb/model/Constructor.java | 15 +- .../dynamodb/model/ConstructorPart.java | 17 +- ...oDbEncryptionBranchKeyIdSupplierInput.java | 29 +- ...DbEncryptionBranchKeyIdSupplierOutput.java | 23 +- .../model/DynamoDbEncryptionConfig.java | 11 +- .../model/DynamoDbEncryptionException.java | 11 +- .../model/DynamoDbTableEncryptionConfig.java | 92 +- .../model/DynamoDbTablesEncryptionConfig.java | 22 +- .../dynamodb/model/EncryptedPart.java | 21 +- .../model/GetBranchKeyIdFromDdbKeyInput.java | 11 +- .../model/GetBranchKeyIdFromDdbKeyOutput.java | 11 +- .../dynamodb/model/GetPrefix.java | 11 +- .../dynamodb/model/GetSegment.java | 25 +- .../dynamodb/model/GetSegments.java | 31 +- .../dynamodb/model/GetSubstring.java | 17 +- .../dynamodb/model/GetSuffix.java | 11 +- .../dynamodb/model/Insert.java | 11 +- .../dynamodb/model/LegacyOverride.java | 31 +- .../dynamodb/model/LegacyPolicy.java | 12 +- .../dbencryptionsdk/dynamodb/model/Lower.java | 11 +- .../dynamodb/model/MultiKeyStore.java | 17 +- .../dynamodb/model/OpaqueError.java | 9 +- .../dynamodb/model/PartOnly.java | 11 +- .../dynamodb/model/PlaintextOverride.java | 12 +- .../dynamodb/model/SearchConfig.java | 27 +- .../dynamodb/model/Shared.java | 11 +- .../dynamodb/model/SharedSet.java | 11 +- .../dynamodb/model/SignedPart.java | 25 +- .../dynamodb/model/SingleKeyStore.java | 17 +- .../dynamodb/model/StandardBeacon.java | 27 +- .../dbencryptionsdk/dynamodb/model/Upper.java | 11 +- .../dynamodb/model/VirtualField.java | 21 +- .../dynamodb/model/VirtualPart.java | 19 +- .../dynamodb/model/VirtualTransform.java | 20 +- .../DynamoDbEncryptionTransforms.java | 351 +++++--- .../dynamodb/transforms/ToDafny.java | 559 +++++++++--- .../dynamodb/transforms/ToNative.java | 797 +++++++++++++----- ...chExecuteStatementInputTransformInput.java | 11 +- ...hExecuteStatementInputTransformOutput.java | 15 +- ...hExecuteStatementOutputTransformInput.java | 17 +- ...ExecuteStatementOutputTransformOutput.java | 15 +- .../BatchGetItemInputTransformInput.java | 11 +- .../BatchGetItemInputTransformOutput.java | 11 +- .../BatchGetItemOutputTransformInput.java | 17 +- .../BatchGetItemOutputTransformOutput.java | 11 +- .../BatchWriteItemInputTransformInput.java | 11 +- .../BatchWriteItemInputTransformOutput.java | 11 +- .../BatchWriteItemOutputTransformInput.java | 17 +- .../BatchWriteItemOutputTransformOutput.java | 11 +- .../transforms/model/CollectionOfErrors.java | 5 +- .../model/DeleteItemInputTransformInput.java | 11 +- .../model/DeleteItemInputTransformOutput.java | 11 +- .../model/DeleteItemOutputTransformInput.java | 17 +- .../DeleteItemOutputTransformOutput.java | 11 +- ...DynamoDbEncryptionTransformsException.java | 11 +- .../ExecuteStatementInputTransformInput.java | 11 +- .../ExecuteStatementInputTransformOutput.java | 11 +- .../ExecuteStatementOutputTransformInput.java | 17 +- ...ExecuteStatementOutputTransformOutput.java | 15 +- ...ExecuteTransactionInputTransformInput.java | 11 +- ...xecuteTransactionInputTransformOutput.java | 15 +- ...xecuteTransactionOutputTransformInput.java | 17 +- ...ecuteTransactionOutputTransformOutput.java | 15 +- .../model/GetItemInputTransformInput.java | 11 +- .../model/GetItemInputTransformOutput.java | 11 +- .../model/GetItemOutputTransformInput.java | 17 +- .../model/GetItemOutputTransformOutput.java | 11 +- .../transforms/model/OpaqueError.java | 9 +- .../model/PutItemInputTransformInput.java | 11 +- .../model/PutItemInputTransformOutput.java | 11 +- .../model/PutItemOutputTransformInput.java | 17 +- .../model/PutItemOutputTransformOutput.java | 11 +- .../model/QueryInputTransformInput.java | 11 +- .../model/QueryInputTransformOutput.java | 11 +- .../model/QueryOutputTransformInput.java | 17 +- .../model/QueryOutputTransformOutput.java | 11 +- .../model/ResolveAttributesInput.java | 33 +- .../model/ResolveAttributesOutput.java | 17 +- .../model/ScanInputTransformInput.java | 11 +- .../model/ScanInputTransformOutput.java | 11 +- .../model/ScanOutputTransformInput.java | 17 +- .../model/ScanOutputTransformOutput.java | 11 +- .../TransactGetItemsInputTransformInput.java | 11 +- .../TransactGetItemsInputTransformOutput.java | 11 +- .../TransactGetItemsOutputTransformInput.java | 17 +- ...TransactGetItemsOutputTransformOutput.java | 15 +- ...TransactWriteItemsInputTransformInput.java | 11 +- ...ransactWriteItemsInputTransformOutput.java | 15 +- ...ransactWriteItemsOutputTransformInput.java | 17 +- ...ansactWriteItemsOutputTransformOutput.java | 15 +- .../model/UpdateItemInputTransformInput.java | 11 +- .../model/UpdateItemInputTransformOutput.java | 11 +- .../model/UpdateItemOutputTransformInput.java | 17 +- .../UpdateItemOutputTransformOutput.java | 11 +- .../StructuredEncryption.java | 41 +- .../structuredencryption/ToDafny.java | 506 ++++++++--- .../structuredencryption/ToNative.java | 396 ++++++--- .../model/AuthenticateSchema.java | 11 +- .../model/AuthenticateSchemaContent.java | 11 +- .../model/CollectionOfErrors.java | 5 +- .../model/CryptoSchema.java | 11 +- .../model/CryptoSchemaContent.java | 11 +- .../model/DecryptStructureInput.java | 29 +- .../model/DecryptStructureOutput.java | 17 +- .../model/EncryptStructureInput.java | 29 +- .../model/EncryptStructureOutput.java | 17 +- .../model/OpaqueError.java | 9 +- .../model/ParsedHeader.java | 37 +- .../model/StructuredData.java | 11 +- .../model/StructuredDataContent.java | 11 +- .../model/StructuredDataTerminal.java | 25 +- .../model/StructuredEncryptionConfig.java | 11 +- .../model/StructuredEncryptionException.java | 11 +- .../wrapped/TestDynamoDbEncryption.java | 28 +- 139 files changed, 4876 insertions(+), 1906 deletions(-) diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java index 73b73b0f1..ec09ed123 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java @@ -6,7 +6,6 @@ import Wrappers_Compile.Result; import java.lang.IllegalArgumentException; import java.util.Objects; -import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.DynamoDbEncryptionClient; import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.__default; import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error; import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbEncryptionClient; @@ -15,12 +14,15 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbEncryptionConfig; public class DynamoDbEncryption { + private final IDynamoDbEncryptionClient _impl; protected DynamoDbEncryption(BuilderImpl builder) { DynamoDbEncryptionConfig input = builder.DynamoDbEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue = ToDafny.DynamoDbEncryptionConfig(input); - Result result = __default.DynamoDbEncryption(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue = + ToDafny.DynamoDbEncryptionConfig(input); + Result result = + __default.DynamoDbEncryption(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -42,13 +44,21 @@ public static Builder builder() { * @return Outputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier */ public CreateDynamoDbEncryptionBranchKeyIdSupplierOutput CreateDynamoDbEncryptionBranchKeyIdSupplier( - CreateDynamoDbEncryptionBranchKeyIdSupplierInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue = ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(input); - Result result = this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(dafnyValue); + CreateDynamoDbEncryptionBranchKeyIdSupplierInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue = + ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput, + Error + > result = + this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(result.dtor_value()); + return ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( + result.dtor_value() + ); } protected IDynamoDbEncryptionClient impl() { @@ -56,7 +66,9 @@ protected IDynamoDbEncryptionClient impl() { } public interface Builder { - Builder DynamoDbEncryptionConfig(DynamoDbEncryptionConfig DynamoDbEncryptionConfig); + Builder DynamoDbEncryptionConfig( + DynamoDbEncryptionConfig DynamoDbEncryptionConfig + ); DynamoDbEncryptionConfig DynamoDbEncryptionConfig(); @@ -64,12 +76,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DynamoDbEncryptionConfig DynamoDbEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} - public Builder DynamoDbEncryptionConfig(DynamoDbEncryptionConfig DynamoDbEncryptionConfig) { + public Builder DynamoDbEncryptionConfig( + DynamoDbEncryptionConfig DynamoDbEncryptionConfig + ) { this.DynamoDbEncryptionConfig = DynamoDbEncryptionConfig; return this; } @@ -79,8 +93,10 @@ public DynamoDbEncryptionConfig DynamoDbEncryptionConfig() { } public DynamoDbEncryption build() { - if (Objects.isNull(this.DynamoDbEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbEncryptionConfig`"); + if (Objects.isNull(this.DynamoDbEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbEncryptionConfig`" + ); } return new DynamoDbEncryption(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbKeyBranchKeyIdSupplier.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbKeyBranchKeyIdSupplier.java index cbb65800e..a985b0a02 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbKeyBranchKeyIdSupplier.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbKeyBranchKeyIdSupplier.java @@ -11,31 +11,46 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyInput; import software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyOutput; -public final class DynamoDbKeyBranchKeyIdSupplier implements IDynamoDbKeyBranchKeyIdSupplier { +public final class DynamoDbKeyBranchKeyIdSupplier + implements IDynamoDbKeyBranchKeyIdSupplier { + private final software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier _impl; private DynamoDbKeyBranchKeyIdSupplier( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier iDynamoDbKeyBranchKeyIdSupplier) { - Objects.requireNonNull(iDynamoDbKeyBranchKeyIdSupplier, "Missing value for required argument `iDynamoDbKeyBranchKeyIdSupplier`"); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier iDynamoDbKeyBranchKeyIdSupplier + ) { + Objects.requireNonNull( + iDynamoDbKeyBranchKeyIdSupplier, + "Missing value for required argument `iDynamoDbKeyBranchKeyIdSupplier`" + ); this._impl = iDynamoDbKeyBranchKeyIdSupplier; } public static DynamoDbKeyBranchKeyIdSupplier wrap( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier iDynamoDbKeyBranchKeyIdSupplier) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier iDynamoDbKeyBranchKeyIdSupplier + ) { return new DynamoDbKeyBranchKeyIdSupplier(iDynamoDbKeyBranchKeyIdSupplier); } - public static DynamoDbKeyBranchKeyIdSupplier wrap( - I iDynamoDbKeyBranchKeyIdSupplier) { - Objects.requireNonNull(iDynamoDbKeyBranchKeyIdSupplier, "Missing value for required argument `iDynamoDbKeyBranchKeyIdSupplier`"); - if (iDynamoDbKeyBranchKeyIdSupplier instanceof software.amazon.cryptography.dbencryptionsdk.dynamodb.DynamoDbKeyBranchKeyIdSupplier) { + public static < + I extends IDynamoDbKeyBranchKeyIdSupplier + > DynamoDbKeyBranchKeyIdSupplier wrap(I iDynamoDbKeyBranchKeyIdSupplier) { + Objects.requireNonNull( + iDynamoDbKeyBranchKeyIdSupplier, + "Missing value for required argument `iDynamoDbKeyBranchKeyIdSupplier`" + ); + if ( + iDynamoDbKeyBranchKeyIdSupplier instanceof + software.amazon.cryptography.dbencryptionsdk.dynamodb.DynamoDbKeyBranchKeyIdSupplier + ) { return ((DynamoDbKeyBranchKeyIdSupplier) iDynamoDbKeyBranchKeyIdSupplier); } - return DynamoDbKeyBranchKeyIdSupplier.wrap(new NativeWrapper(iDynamoDbKeyBranchKeyIdSupplier)); + return DynamoDbKeyBranchKeyIdSupplier.wrap( + new NativeWrapper(iDynamoDbKeyBranchKeyIdSupplier) + ); } - public software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier impl( - ) { + public software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier impl() { return this._impl; } @@ -46,39 +61,60 @@ public software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types * @return Outputs for getting the Branch Key that should be used for wrapping and unwrapping data keys. */ public GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKey( - GetBranchKeyIdFromDdbKeyInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyValue = ToDafny.GetBranchKeyIdFromDdbKeyInput(input); - Result result = this._impl.GetBranchKeyIdFromDdbKey(dafnyValue); + GetBranchKeyIdFromDdbKeyInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyValue = + ToDafny.GetBranchKeyIdFromDdbKeyInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput, + Error + > result = this._impl.GetBranchKeyIdFromDdbKey(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.GetBranchKeyIdFromDdbKeyOutput(result.dtor_value()); } - protected static final class NativeWrapper implements software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier { + protected static final class NativeWrapper + implements + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier { + protected final IDynamoDbKeyBranchKeyIdSupplier _impl; NativeWrapper(IDynamoDbKeyBranchKeyIdSupplier nativeImpl) { if (nativeImpl instanceof DynamoDbKeyBranchKeyIdSupplier) { - throw new IllegalArgumentException("Recursive wrapping is strictly forbidden."); + throw new IllegalArgumentException( + "Recursive wrapping is strictly forbidden." + ); } this._impl = nativeImpl; } - public Result GetBranchKeyIdFromDdbKey( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyInput) { - GetBranchKeyIdFromDdbKeyInput nativeInput = ToNative.GetBranchKeyIdFromDdbKeyInput(dafnyInput); + public Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput, + Error + > GetBranchKeyIdFromDdbKey( + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyInput + ) { + GetBranchKeyIdFromDdbKeyInput nativeInput = + ToNative.GetBranchKeyIdFromDdbKeyInput(dafnyInput); try { - GetBranchKeyIdFromDdbKeyOutput nativeOutput = this._impl.GetBranchKeyIdFromDdbKey(nativeInput); - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput dafnyOutput = ToDafny.GetBranchKeyIdFromDdbKeyOutput(nativeOutput); + GetBranchKeyIdFromDdbKeyOutput nativeOutput = + this._impl.GetBranchKeyIdFromDdbKey(nativeInput); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput dafnyOutput = + ToDafny.GetBranchKeyIdFromDdbKeyOutput(nativeOutput); return Result.create_Success(dafnyOutput); } catch (RuntimeException ex) { return Result.create_Failure(ToDafny.Error(ex)); } } - public Result GetBranchKeyIdFromDdbKey_k( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyInput) { + public Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput, + Error + > GetBranchKeyIdFromDdbKey_k( + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyInput + ) { throw new RuntimeException("Not supported at this time."); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/IDynamoDbKeyBranchKeyIdSupplier.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/IDynamoDbKeyBranchKeyIdSupplier.java index e6ddaba2c..7cb53b848 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/IDynamoDbKeyBranchKeyIdSupplier.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/IDynamoDbKeyBranchKeyIdSupplier.java @@ -13,5 +13,7 @@ public interface IDynamoDbKeyBranchKeyIdSupplier { * @param input Inputs for getting the Branch Key that should be used for wrapping and unwrapping data keys. * @return Outputs for getting the Branch Key that should be used for wrapping and unwrapping data keys. */ - GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKey(GetBranchKeyIdFromDdbKeyInput input); + GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKey( + GetBranchKeyIdFromDdbKeyInput input + ); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ILegacyDynamoDbEncryptor.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ILegacyDynamoDbEncryptor.java index 825d315a4..f7c4ee5e9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ILegacyDynamoDbEncryptor.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ILegacyDynamoDbEncryptor.java @@ -3,5 +3,4 @@ // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. package software.amazon.cryptography.dbencryptionsdk.dynamodb; -public interface ILegacyDynamoDbEncryptor { -} +public interface ILegacyDynamoDbEncryptor {} diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/LegacyDynamoDbEncryptor.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/LegacyDynamoDbEncryptor.java index 07ac066d6..e73ed1165 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/LegacyDynamoDbEncryptor.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/LegacyDynamoDbEncryptor.java @@ -7,39 +7,58 @@ import java.util.Objects; public final class LegacyDynamoDbEncryptor implements ILegacyDynamoDbEncryptor { + private final software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor _impl; private LegacyDynamoDbEncryptor( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor iLegacyDynamoDbEncryptor) { - Objects.requireNonNull(iLegacyDynamoDbEncryptor, "Missing value for required argument `iLegacyDynamoDbEncryptor`"); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor iLegacyDynamoDbEncryptor + ) { + Objects.requireNonNull( + iLegacyDynamoDbEncryptor, + "Missing value for required argument `iLegacyDynamoDbEncryptor`" + ); this._impl = iLegacyDynamoDbEncryptor; } public static LegacyDynamoDbEncryptor wrap( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor iLegacyDynamoDbEncryptor) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor iLegacyDynamoDbEncryptor + ) { return new LegacyDynamoDbEncryptor(iLegacyDynamoDbEncryptor); } - public static LegacyDynamoDbEncryptor wrap( - I iLegacyDynamoDbEncryptor) { - Objects.requireNonNull(iLegacyDynamoDbEncryptor, "Missing value for required argument `iLegacyDynamoDbEncryptor`"); - if (iLegacyDynamoDbEncryptor instanceof software.amazon.cryptography.dbencryptionsdk.dynamodb.LegacyDynamoDbEncryptor) { + public static < + I extends ILegacyDynamoDbEncryptor + > LegacyDynamoDbEncryptor wrap(I iLegacyDynamoDbEncryptor) { + Objects.requireNonNull( + iLegacyDynamoDbEncryptor, + "Missing value for required argument `iLegacyDynamoDbEncryptor`" + ); + if ( + iLegacyDynamoDbEncryptor instanceof + software.amazon.cryptography.dbencryptionsdk.dynamodb.LegacyDynamoDbEncryptor + ) { return ((LegacyDynamoDbEncryptor) iLegacyDynamoDbEncryptor); } - return LegacyDynamoDbEncryptor.wrap(new NativeWrapper(iLegacyDynamoDbEncryptor)); + return LegacyDynamoDbEncryptor.wrap( + new NativeWrapper(iLegacyDynamoDbEncryptor) + ); } - public software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor impl( - ) { + public software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor impl() { return this._impl; } - protected static final class NativeWrapper implements software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor { + protected static final class NativeWrapper + implements + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor { + protected final ILegacyDynamoDbEncryptor _impl; NativeWrapper(ILegacyDynamoDbEncryptor nativeImpl) { if (nativeImpl instanceof LegacyDynamoDbEncryptor) { - throw new IllegalArgumentException("Recursive wrapping is strictly forbidden."); + throw new IllegalArgumentException( + "Recursive wrapping is strictly forbidden." + ); } this._impl = nativeImpl; } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToDafny.java index b3e5ccf18..fd041a8a3 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToDafny.java @@ -68,6 +68,7 @@ import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof DynamoDbEncryptionException) { return ToDafny.Error((DynamoDbEncryptionException) nativeValue); @@ -86,201 +87,366 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static AsSet AsSet( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.AsSet nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.AsSet nativeValue + ) { return new AsSet(); } public static BeaconVersion BeaconVersion( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconVersion nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconVersion nativeValue + ) { Integer version; version = (nativeValue.version()); IKeyStoreClient keyStore; - keyStore = software.amazon.cryptography.keystore.ToDafny.KeyStore(nativeValue.keyStore()); + keyStore = + software.amazon.cryptography.keystore.ToDafny.KeyStore( + nativeValue.keyStore() + ); BeaconKeySource keySource; keySource = ToDafny.BeaconKeySource(nativeValue.keySource()); DafnySequence standardBeacons; standardBeacons = ToDafny.StandardBeaconList(nativeValue.standardBeacons()); Option> compoundBeacons; - compoundBeacons = (Objects.nonNull(nativeValue.compoundBeacons()) && nativeValue.compoundBeacons().size() > 0) ? - Option.create_Some(ToDafny.CompoundBeaconList(nativeValue.compoundBeacons())) + compoundBeacons = + (Objects.nonNull(nativeValue.compoundBeacons()) && + nativeValue.compoundBeacons().size() > 0) + ? Option.create_Some( + ToDafny.CompoundBeaconList(nativeValue.compoundBeacons()) + ) : Option.create_None(); Option> virtualFields; - virtualFields = (Objects.nonNull(nativeValue.virtualFields()) && nativeValue.virtualFields().size() > 0) ? - Option.create_Some(ToDafny.VirtualFieldList(nativeValue.virtualFields())) + virtualFields = + (Objects.nonNull(nativeValue.virtualFields()) && + nativeValue.virtualFields().size() > 0) + ? Option.create_Some( + ToDafny.VirtualFieldList(nativeValue.virtualFields()) + ) : Option.create_None(); Option> encryptedParts; - encryptedParts = (Objects.nonNull(nativeValue.encryptedParts()) && nativeValue.encryptedParts().size() > 0) ? - Option.create_Some(ToDafny.EncryptedPartsList(nativeValue.encryptedParts())) + encryptedParts = + (Objects.nonNull(nativeValue.encryptedParts()) && + nativeValue.encryptedParts().size() > 0) + ? Option.create_Some( + ToDafny.EncryptedPartsList(nativeValue.encryptedParts()) + ) : Option.create_None(); Option> signedParts; - signedParts = (Objects.nonNull(nativeValue.signedParts()) && nativeValue.signedParts().size() > 0) ? - Option.create_Some(ToDafny.SignedPartsList(nativeValue.signedParts())) + signedParts = + (Objects.nonNull(nativeValue.signedParts()) && + nativeValue.signedParts().size() > 0) + ? Option.create_Some(ToDafny.SignedPartsList(nativeValue.signedParts())) : Option.create_None(); - return new BeaconVersion(version, keyStore, keySource, standardBeacons, compoundBeacons, virtualFields, encryptedParts, signedParts); + return new BeaconVersion( + version, + keyStore, + keySource, + standardBeacons, + compoundBeacons, + virtualFields, + encryptedParts, + signedParts + ); } public static CompoundBeacon CompoundBeacon( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CompoundBeacon nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CompoundBeacon nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); DafnySequence split; - split = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.split()); + split = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.split() + ); Option> encrypted; - encrypted = (Objects.nonNull(nativeValue.encrypted()) && nativeValue.encrypted().size() > 0) ? - Option.create_Some(ToDafny.EncryptedPartsList(nativeValue.encrypted())) + encrypted = + (Objects.nonNull(nativeValue.encrypted()) && + nativeValue.encrypted().size() > 0) + ? Option.create_Some( + ToDafny.EncryptedPartsList(nativeValue.encrypted()) + ) : Option.create_None(); Option> signed; - signed = (Objects.nonNull(nativeValue.signed()) && nativeValue.signed().size() > 0) ? - Option.create_Some(ToDafny.SignedPartsList(nativeValue.signed())) + signed = + (Objects.nonNull(nativeValue.signed()) && nativeValue.signed().size() > 0) + ? Option.create_Some(ToDafny.SignedPartsList(nativeValue.signed())) : Option.create_None(); Option> constructors; - constructors = (Objects.nonNull(nativeValue.constructors()) && nativeValue.constructors().size() > 0) ? - Option.create_Some(ToDafny.ConstructorList(nativeValue.constructors())) + constructors = + (Objects.nonNull(nativeValue.constructors()) && + nativeValue.constructors().size() > 0) + ? Option.create_Some( + ToDafny.ConstructorList(nativeValue.constructors()) + ) : Option.create_None(); return new CompoundBeacon(name, split, encrypted, signed, constructors); } public static Constructor Constructor( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Constructor nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Constructor nativeValue + ) { DafnySequence parts; parts = ToDafny.ConstructorPartList(nativeValue.parts()); return new Constructor(parts); } public static ConstructorPart ConstructorPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.ConstructorPart nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.ConstructorPart nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); Boolean required; required = (nativeValue.required()); return new ConstructorPart(name, required); } public static CreateDynamoDbEncryptionBranchKeyIdSupplierInput CreateDynamoDbEncryptionBranchKeyIdSupplierInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierInput nativeValue + ) { software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier; - ddbKeyBranchKeyIdSupplier = ToDafny.DynamoDbKeyBranchKeyIdSupplier(nativeValue.ddbKeyBranchKeyIdSupplier()); - return new CreateDynamoDbEncryptionBranchKeyIdSupplierInput(ddbKeyBranchKeyIdSupplier); + ddbKeyBranchKeyIdSupplier = + ToDafny.DynamoDbKeyBranchKeyIdSupplier( + nativeValue.ddbKeyBranchKeyIdSupplier() + ); + return new CreateDynamoDbEncryptionBranchKeyIdSupplierInput( + ddbKeyBranchKeyIdSupplier + ); } public static CreateDynamoDbEncryptionBranchKeyIdSupplierOutput CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput nativeValue + ) { IBranchKeyIdSupplier branchKeyIdSupplier; - branchKeyIdSupplier = software.amazon.cryptography.materialproviders.ToDafny.BranchKeyIdSupplier(nativeValue.branchKeyIdSupplier()); - return new CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(branchKeyIdSupplier); + branchKeyIdSupplier = + software.amazon.cryptography.materialproviders.ToDafny.BranchKeyIdSupplier( + nativeValue.branchKeyIdSupplier() + ); + return new CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( + branchKeyIdSupplier + ); } public static DynamoDbEncryptionConfig DynamoDbEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbEncryptionConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbEncryptionConfig nativeValue + ) { return new DynamoDbEncryptionConfig(); } public static DynamoDbTableEncryptionConfig DynamoDbTableEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTableEncryptionConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTableEncryptionConfig nativeValue + ) { DafnySequence logicalTableName; - logicalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.logicalTableName()); + logicalTableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.logicalTableName() + ); DafnySequence partitionKeyName; - partitionKeyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.partitionKeyName()); + partitionKeyName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.partitionKeyName() + ); Option> sortKeyName; - sortKeyName = Objects.nonNull(nativeValue.sortKeyName()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sortKeyName())) + sortKeyName = + Objects.nonNull(nativeValue.sortKeyName()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.sortKeyName() + ) + ) : Option.create_None(); Option search; - search = Objects.nonNull(nativeValue.search()) ? - Option.create_Some(ToDafny.SearchConfig(nativeValue.search())) + search = + Objects.nonNull(nativeValue.search()) + ? Option.create_Some(ToDafny.SearchConfig(nativeValue.search())) : Option.create_None(); - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); - Option>> allowedUnsignedAttributes; - allowedUnsignedAttributes = (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && nativeValue.allowedUnsignedAttributes().size() > 0) ? - Option.create_Some(software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList(nativeValue.allowedUnsignedAttributes())) + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); + Option< + DafnySequence> + > allowedUnsignedAttributes; + allowedUnsignedAttributes = + (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && + nativeValue.allowedUnsignedAttributes().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList( + nativeValue.allowedUnsignedAttributes() + ) + ) : Option.create_None(); Option> allowedUnsignedAttributePrefix; - allowedUnsignedAttributePrefix = Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.allowedUnsignedAttributePrefix())) + allowedUnsignedAttributePrefix = + Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.allowedUnsignedAttributePrefix() + ) + ) : Option.create_None(); Option algorithmSuiteId; - algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId())) + algorithmSuiteId = + Objects.nonNull(nativeValue.algorithmSuiteId()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ) + ) : Option.create_None(); Option keyring; - keyring = Objects.nonNull(nativeValue.keyring()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.Keyring(nativeValue.keyring())) + keyring = + Objects.nonNull(nativeValue.keyring()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.Keyring( + nativeValue.keyring() + ) + ) : Option.create_None(); Option cmm; - cmm = Objects.nonNull(nativeValue.cmm()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm())) + cmm = + Objects.nonNull(nativeValue.cmm()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ) + ) : Option.create_None(); Option legacyOverride; - legacyOverride = Objects.nonNull(nativeValue.legacyOverride()) ? - Option.create_Some(ToDafny.LegacyOverride(nativeValue.legacyOverride())) + legacyOverride = + Objects.nonNull(nativeValue.legacyOverride()) + ? Option.create_Some( + ToDafny.LegacyOverride(nativeValue.legacyOverride()) + ) : Option.create_None(); Option plaintextOverride; - plaintextOverride = Objects.nonNull(nativeValue.plaintextOverride()) ? - Option.create_Some(ToDafny.PlaintextOverride(nativeValue.plaintextOverride())) + plaintextOverride = + Objects.nonNull(nativeValue.plaintextOverride()) + ? Option.create_Some( + ToDafny.PlaintextOverride(nativeValue.plaintextOverride()) + ) : Option.create_None(); - return new DynamoDbTableEncryptionConfig(logicalTableName, partitionKeyName, sortKeyName, search, attributeActionsOnEncrypt, allowedUnsignedAttributes, allowedUnsignedAttributePrefix, algorithmSuiteId, keyring, cmm, legacyOverride, plaintextOverride); + return new DynamoDbTableEncryptionConfig( + logicalTableName, + partitionKeyName, + sortKeyName, + search, + attributeActionsOnEncrypt, + allowedUnsignedAttributes, + allowedUnsignedAttributePrefix, + algorithmSuiteId, + keyring, + cmm, + legacyOverride, + plaintextOverride + ); } public static DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTablesEncryptionConfig nativeValue) { - DafnyMap, ? extends DynamoDbTableEncryptionConfig> tableEncryptionConfigs; - tableEncryptionConfigs = ToDafny.DynamoDbTableEncryptionConfigList(nativeValue.tableEncryptionConfigs()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTablesEncryptionConfig nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends DynamoDbTableEncryptionConfig + > tableEncryptionConfigs; + tableEncryptionConfigs = + ToDafny.DynamoDbTableEncryptionConfigList( + nativeValue.tableEncryptionConfigs() + ); return new DynamoDbTablesEncryptionConfig(tableEncryptionConfigs); } public static EncryptedPart EncryptedPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedPart nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedPart nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); DafnySequence prefix; - prefix = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.prefix()); + prefix = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.prefix() + ); return new EncryptedPart(name, prefix); } public static GetBranchKeyIdFromDdbKeyInput GetBranchKeyIdFromDdbKeyInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyInput nativeValue) { - DafnyMap, ? extends AttributeValue> ddbKey; - ddbKey = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.Key(nativeValue.ddbKey()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyInput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > ddbKey; + ddbKey = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.Key( + nativeValue.ddbKey() + ); return new GetBranchKeyIdFromDdbKeyInput(ddbKey); } public static GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKeyOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetBranchKeyIdFromDdbKeyOutput nativeValue + ) { DafnySequence branchKeyId; - branchKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyId()); + branchKeyId = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.branchKeyId() + ); return new GetBranchKeyIdFromDdbKeyOutput(branchKeyId); } public static GetPrefix GetPrefix( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetPrefix nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetPrefix nativeValue + ) { Integer length; length = (nativeValue.length()); return new GetPrefix(length); } public static GetSegment GetSegment( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSegment nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSegment nativeValue + ) { DafnySequence split; - split = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.split()); + split = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.split() + ); Integer index; index = (nativeValue.index()); return new GetSegment(split, index); } public static GetSegments GetSegments( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSegments nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSegments nativeValue + ) { DafnySequence split; - split = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.split()); + split = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.split() + ); Integer low; low = (nativeValue.low()); Integer high; @@ -289,7 +455,8 @@ public static GetSegments GetSegments( } public static GetSubstring GetSubstring( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSubstring nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSubstring nativeValue + ) { Integer low; low = (nativeValue.low()); Integer high; @@ -298,59 +465,91 @@ public static GetSubstring GetSubstring( } public static GetSuffix GetSuffix( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSuffix nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetSuffix nativeValue + ) { Integer length; length = (nativeValue.length()); return new GetSuffix(length); } public static Insert Insert( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Insert nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Insert nativeValue + ) { DafnySequence literal; - literal = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.literal()); + literal = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.literal() + ); return new Insert(literal); } public static LegacyOverride LegacyOverride( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyOverride nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyOverride nativeValue + ) { LegacyPolicy policy; policy = ToDafny.LegacyPolicy(nativeValue.policy()); software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor encryptor; encryptor = ToDafny.LegacyDynamoDbEncryptor(nativeValue.encryptor()); - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); Option defaultAttributeFlag; - defaultAttributeFlag = Objects.nonNull(nativeValue.defaultAttributeFlag()) ? - Option.create_Some(software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny.CryptoAction(nativeValue.defaultAttributeFlag())) + defaultAttributeFlag = + Objects.nonNull(nativeValue.defaultAttributeFlag()) + ? Option.create_Some( + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny.CryptoAction( + nativeValue.defaultAttributeFlag() + ) + ) : Option.create_None(); - return new LegacyOverride(policy, encryptor, attributeActionsOnEncrypt, defaultAttributeFlag); + return new LegacyOverride( + policy, + encryptor, + attributeActionsOnEncrypt, + defaultAttributeFlag + ); } public static Lower Lower( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Lower nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Lower nativeValue + ) { return new Lower(); } public static MultiKeyStore MultiKeyStore( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.MultiKeyStore nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.MultiKeyStore nativeValue + ) { DafnySequence keyFieldName; - keyFieldName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyFieldName()); + keyFieldName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.keyFieldName() + ); Integer cacheTTL; cacheTTL = (nativeValue.cacheTTL()); Option cache; - cache = Objects.nonNull(nativeValue.cache()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.CacheType(nativeValue.cache())) + cache = + Objects.nonNull(nativeValue.cache()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.CacheType( + nativeValue.cache() + ) + ) : Option.create_None(); return new MultiKeyStore(keyFieldName, cacheTTL, cache); } public static PartOnly PartOnly( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PartOnly nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PartOnly nativeValue + ) { return new PartOnly(); } public static SearchConfig SearchConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SearchConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SearchConfig nativeValue + ) { DafnySequence versions; versions = ToDafny.BeaconVersionList(nativeValue.versions()); Integer writeVersion; @@ -359,140 +558,217 @@ public static SearchConfig SearchConfig( } public static Shared Shared( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Shared nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Shared nativeValue + ) { DafnySequence other; - other = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.other()); + other = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.other() + ); return new Shared(other); } public static SharedSet SharedSet( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SharedSet nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SharedSet nativeValue + ) { DafnySequence other; - other = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.other()); + other = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.other() + ); return new SharedSet(other); } public static SignedPart SignedPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SignedPart nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SignedPart nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); DafnySequence prefix; - prefix = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.prefix()); + prefix = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.prefix() + ); Option> loc; - loc = Objects.nonNull(nativeValue.loc()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.loc())) + loc = + Objects.nonNull(nativeValue.loc()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.loc() + ) + ) : Option.create_None(); return new SignedPart(name, prefix, loc); } public static SingleKeyStore SingleKeyStore( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SingleKeyStore nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SingleKeyStore nativeValue + ) { DafnySequence keyId; - keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()); + keyId = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.keyId() + ); Integer cacheTTL; cacheTTL = (nativeValue.cacheTTL()); return new SingleKeyStore(keyId, cacheTTL); } public static StandardBeacon StandardBeacon( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.StandardBeacon nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.StandardBeacon nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); Integer length; length = (nativeValue.length()); Option> loc; - loc = Objects.nonNull(nativeValue.loc()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.loc())) + loc = + Objects.nonNull(nativeValue.loc()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.loc() + ) + ) : Option.create_None(); Option style; - style = Objects.nonNull(nativeValue.style()) ? - Option.create_Some(ToDafny.BeaconStyle(nativeValue.style())) + style = + Objects.nonNull(nativeValue.style()) + ? Option.create_Some(ToDafny.BeaconStyle(nativeValue.style())) : Option.create_None(); return new StandardBeacon(name, length, loc, style); } public static Upper Upper( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Upper nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Upper nativeValue + ) { return new Upper(); } public static VirtualField VirtualField( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualField nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualField nativeValue + ) { DafnySequence name; - name = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + name = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.name() + ); DafnySequence parts; parts = ToDafny.VirtualPartList(nativeValue.parts()); return new VirtualField(name, parts); } public static VirtualPart VirtualPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualPart nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualPart nativeValue + ) { DafnySequence loc; - loc = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.loc()); + loc = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.loc() + ); Option> trans; - trans = (Objects.nonNull(nativeValue.trans()) && nativeValue.trans().size() > 0) ? - Option.create_Some(ToDafny.VirtualTransformList(nativeValue.trans())) + trans = + (Objects.nonNull(nativeValue.trans()) && nativeValue.trans().size() > 0) + ? Option.create_Some(ToDafny.VirtualTransformList(nativeValue.trans())) : Option.create_None(); return new VirtualPart(loc, trans); } public static Error Error(DynamoDbEncryptionException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_DynamoDbEncryptionException(message); } public static LegacyPolicy LegacyPolicy( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyPolicy nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyPolicy nativeValue + ) { switch (nativeValue) { - case FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT: { - return LegacyPolicy.create_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); - } - case FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT: { - return LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); - } - case FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT: { - return LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__FORBID__LEGACY__DECRYPT(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy."); - } + case FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT: + { + return LegacyPolicy.create_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); + } + case FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT: + { + return LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT(); + } + case FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT: + { + return LegacyPolicy.create_FORBID__LEGACY__ENCRYPT__FORBID__LEGACY__DECRYPT(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy." + ); + } } } public static PlaintextOverride PlaintextOverride( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PlaintextOverride nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PlaintextOverride nativeValue + ) { switch (nativeValue) { - case FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ: { - return PlaintextOverride.create_FORCE__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); - } - case FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ: { - return PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); - } - case FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ: { - return PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__FORBID__PLAINTEXT__READ(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride."); - } + case FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ: + { + return PlaintextOverride.create_FORCE__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); + } + case FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ: + { + return PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ(); + } + case FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ: + { + return PlaintextOverride.create_FORBID__PLAINTEXT__WRITE__FORBID__PLAINTEXT__READ(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride." + ); + } } } public static BeaconKeySource BeaconKeySource( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconKeySource nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconKeySource nativeValue + ) { if (Objects.nonNull(nativeValue.single())) { - return BeaconKeySource.create_single(ToDafny.SingleKeyStore(nativeValue.single())); + return BeaconKeySource.create_single( + ToDafny.SingleKeyStore(nativeValue.single()) + ); } if (Objects.nonNull(nativeValue.multi())) { - return BeaconKeySource.create_multi(ToDafny.MultiKeyStore(nativeValue.multi())); + return BeaconKeySource.create_multi( + ToDafny.MultiKeyStore(nativeValue.multi()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource." + ); } public static BeaconStyle BeaconStyle( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconStyle nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconStyle nativeValue + ) { if (Objects.nonNull(nativeValue.partOnly())) { - return BeaconStyle.create_partOnly(ToDafny.PartOnly(nativeValue.partOnly())); + return BeaconStyle.create_partOnly( + ToDafny.PartOnly(nativeValue.partOnly()) + ); } if (Objects.nonNull(nativeValue.shared())) { return BeaconStyle.create_shared(ToDafny.Shared(nativeValue.shared())); @@ -501,13 +777,20 @@ public static BeaconStyle BeaconStyle( return BeaconStyle.create_asSet(ToDafny.AsSet(nativeValue.asSet())); } if (Objects.nonNull(nativeValue.sharedSet())) { - return BeaconStyle.create_sharedSet(ToDafny.SharedSet(nativeValue.sharedSet())); + return BeaconStyle.create_sharedSet( + ToDafny.SharedSet(nativeValue.sharedSet()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle." + ); } public static VirtualTransform VirtualTransform( - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualTransform nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualTransform nativeValue + ) { if (Objects.nonNull(nativeValue.upper())) { return VirtualTransform.create_upper(ToDafny.Upper(nativeValue.upper())); } @@ -515,133 +798,209 @@ public static VirtualTransform VirtualTransform( return VirtualTransform.create_lower(ToDafny.Lower(nativeValue.lower())); } if (Objects.nonNull(nativeValue.insert())) { - return VirtualTransform.create_insert(ToDafny.Insert(nativeValue.insert())); + return VirtualTransform.create_insert( + ToDafny.Insert(nativeValue.insert()) + ); } if (Objects.nonNull(nativeValue.prefix())) { - return VirtualTransform.create_prefix(ToDafny.GetPrefix(nativeValue.prefix())); + return VirtualTransform.create_prefix( + ToDafny.GetPrefix(nativeValue.prefix()) + ); } if (Objects.nonNull(nativeValue.suffix())) { - return VirtualTransform.create_suffix(ToDafny.GetSuffix(nativeValue.suffix())); + return VirtualTransform.create_suffix( + ToDafny.GetSuffix(nativeValue.suffix()) + ); } if (Objects.nonNull(nativeValue.substring())) { - return VirtualTransform.create_substring(ToDafny.GetSubstring(nativeValue.substring())); + return VirtualTransform.create_substring( + ToDafny.GetSubstring(nativeValue.substring()) + ); } if (Objects.nonNull(nativeValue.segment())) { - return VirtualTransform.create_segment(ToDafny.GetSegment(nativeValue.segment())); + return VirtualTransform.create_segment( + ToDafny.GetSegment(nativeValue.segment()) + ); } if (Objects.nonNull(nativeValue.segments())) { - return VirtualTransform.create_segments(ToDafny.GetSegments(nativeValue.segments())); + return VirtualTransform.create_segments( + ToDafny.GetSegments(nativeValue.segments()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform." + ); } public static DafnySequence BeaconVersionList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.BeaconVersion + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::BeaconVersion, - BeaconVersion._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::BeaconVersion, + BeaconVersion._typeDescriptor() + ); } public static DafnySequence CompoundBeaconList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CompoundBeacon + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::CompoundBeacon, - CompoundBeacon._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::CompoundBeacon, + CompoundBeacon._typeDescriptor() + ); } public static DafnySequence ConstructorList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.Constructor + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::Constructor, - Constructor._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::Constructor, + Constructor._typeDescriptor() + ); } public static DafnySequence ConstructorPartList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.ConstructorPart + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::ConstructorPart, - ConstructorPart._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::ConstructorPart, + ConstructorPart._typeDescriptor() + ); } public static DafnySequence EncryptedPartsList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedPart + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::EncryptedPart, - EncryptedPart._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::EncryptedPart, + EncryptedPart._typeDescriptor() + ); } public static DafnySequence SignedPartsList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.SignedPart + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::SignedPart, - SignedPart._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::SignedPart, + SignedPart._typeDescriptor() + ); } public static DafnySequence StandardBeaconList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.StandardBeacon + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::StandardBeacon, - StandardBeacon._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::StandardBeacon, + StandardBeacon._typeDescriptor() + ); } public static DafnySequence VirtualFieldList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualField + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualField, - VirtualField._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualField, + VirtualField._typeDescriptor() + ); } public static DafnySequence VirtualPartList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualPart + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualPart, - VirtualPart._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualPart, + VirtualPart._typeDescriptor() + ); } public static DafnySequence VirtualTransformList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.VirtualTransform + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualTransform, - VirtualTransform._typeDescriptor()); - } - - public static DafnyMap, ? extends CryptoAction> AttributeActions( - Map nativeValue) { + nativeValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::VirtualTransform, + VirtualTransform._typeDescriptor() + ); + } + + public static DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > AttributeActions( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoAction); - } - - public static DafnyMap, ? extends DynamoDbTableEncryptionConfig> DynamoDbTableEncryptionConfigList( - Map nativeValue) { + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoAction + ); + } + + public static DafnyMap< + ? extends DafnySequence, + ? extends DynamoDbTableEncryptionConfig + > DynamoDbTableEncryptionConfigList( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTableEncryptionConfig + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::DynamoDbTableEncryptionConfig); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::DynamoDbTableEncryptionConfig + ); } public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier DynamoDbKeyBranchKeyIdSupplier( - IDynamoDbKeyBranchKeyIdSupplier nativeValue) { + IDynamoDbKeyBranchKeyIdSupplier nativeValue + ) { return DynamoDbKeyBranchKeyIdSupplier.wrap(nativeValue).impl(); } public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor LegacyDynamoDbEncryptor( - ILegacyDynamoDbEncryptor nativeValue) { + ILegacyDynamoDbEncryptor nativeValue + ) { return LegacyDynamoDbEncryptor.wrap(nativeValue).impl(); } - public static IDynamoDbEncryptionClient DynamoDbEncryption(DynamoDbEncryption nativeValue) { + public static IDynamoDbEncryptionClient DynamoDbEncryption( + DynamoDbEncryption nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToNative.java index ee31ab4eb..933c696e1 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/ToNative.java @@ -59,6 +59,7 @@ import software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -68,16 +69,29 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } - public static DynamoDbEncryptionException Error(Error_DynamoDbEncryptionException dafnyValue) { - DynamoDbEncryptionException.Builder nativeBuilder = DynamoDbEncryptionException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + public static DynamoDbEncryptionException Error( + Error_DynamoDbEncryptionException dafnyValue + ) { + DynamoDbEncryptionException.Builder nativeBuilder = + DynamoDbEncryptionException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } @@ -92,16 +106,24 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_AwsCryptographyPrimitives()) { - return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives()); + return software.amazon.cryptography.primitives.ToNative.Error( + dafnyValue.dtor_AwsCryptographyPrimitives() + ); } if (dafnyValue.is_ComAmazonawsDynamodb()) { - return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsDynamodb()); + return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error( + dafnyValue.dtor_ComAmazonawsDynamodb() + ); } if (dafnyValue.is_AwsCryptographyMaterialProviders()) { - return software.amazon.cryptography.materialproviders.ToNative.Error(dafnyValue.dtor_AwsCryptographyMaterialProviders()); + return software.amazon.cryptography.materialproviders.ToNative.Error( + dafnyValue.dtor_AwsCryptographyMaterialProviders() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkStructuredEncryption()) { - return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption()); + return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -109,176 +131,316 @@ public static RuntimeException Error(Error dafnyValue) { } public static AsSet AsSet( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.AsSet dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.AsSet dafnyValue + ) { AsSet.Builder nativeBuilder = AsSet.builder(); return nativeBuilder.build(); } public static BeaconVersion BeaconVersion( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconVersion dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconVersion dafnyValue + ) { BeaconVersion.Builder nativeBuilder = BeaconVersion.builder(); nativeBuilder.version((dafnyValue.dtor_version())); - nativeBuilder.keyStore(software.amazon.cryptography.keystore.ToNative.KeyStore(dafnyValue.dtor_keyStore())); - nativeBuilder.keySource(ToNative.BeaconKeySource(dafnyValue.dtor_keySource())); - nativeBuilder.standardBeacons(ToNative.StandardBeaconList(dafnyValue.dtor_standardBeacons())); + nativeBuilder.keyStore( + software.amazon.cryptography.keystore.ToNative.KeyStore( + dafnyValue.dtor_keyStore() + ) + ); + nativeBuilder.keySource( + ToNative.BeaconKeySource(dafnyValue.dtor_keySource()) + ); + nativeBuilder.standardBeacons( + ToNative.StandardBeaconList(dafnyValue.dtor_standardBeacons()) + ); if (dafnyValue.dtor_compoundBeacons().is_Some()) { - nativeBuilder.compoundBeacons(ToNative.CompoundBeaconList(dafnyValue.dtor_compoundBeacons().dtor_value())); + nativeBuilder.compoundBeacons( + ToNative.CompoundBeaconList( + dafnyValue.dtor_compoundBeacons().dtor_value() + ) + ); } if (dafnyValue.dtor_virtualFields().is_Some()) { - nativeBuilder.virtualFields(ToNative.VirtualFieldList(dafnyValue.dtor_virtualFields().dtor_value())); + nativeBuilder.virtualFields( + ToNative.VirtualFieldList(dafnyValue.dtor_virtualFields().dtor_value()) + ); } if (dafnyValue.dtor_encryptedParts().is_Some()) { - nativeBuilder.encryptedParts(ToNative.EncryptedPartsList(dafnyValue.dtor_encryptedParts().dtor_value())); + nativeBuilder.encryptedParts( + ToNative.EncryptedPartsList( + dafnyValue.dtor_encryptedParts().dtor_value() + ) + ); } if (dafnyValue.dtor_signedParts().is_Some()) { - nativeBuilder.signedParts(ToNative.SignedPartsList(dafnyValue.dtor_signedParts().dtor_value())); + nativeBuilder.signedParts( + ToNative.SignedPartsList(dafnyValue.dtor_signedParts().dtor_value()) + ); } return nativeBuilder.build(); } public static CompoundBeacon CompoundBeacon( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CompoundBeacon dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CompoundBeacon dafnyValue + ) { CompoundBeacon.Builder nativeBuilder = CompoundBeacon.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); - nativeBuilder.split(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_split())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); + nativeBuilder.split( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_split() + ) + ); if (dafnyValue.dtor_encrypted().is_Some()) { - nativeBuilder.encrypted(ToNative.EncryptedPartsList(dafnyValue.dtor_encrypted().dtor_value())); + nativeBuilder.encrypted( + ToNative.EncryptedPartsList(dafnyValue.dtor_encrypted().dtor_value()) + ); } if (dafnyValue.dtor_signed().is_Some()) { - nativeBuilder.signed(ToNative.SignedPartsList(dafnyValue.dtor_signed().dtor_value())); + nativeBuilder.signed( + ToNative.SignedPartsList(dafnyValue.dtor_signed().dtor_value()) + ); } if (dafnyValue.dtor_constructors().is_Some()) { - nativeBuilder.constructors(ToNative.ConstructorList(dafnyValue.dtor_constructors().dtor_value())); + nativeBuilder.constructors( + ToNative.ConstructorList(dafnyValue.dtor_constructors().dtor_value()) + ); } return nativeBuilder.build(); } public static Constructor Constructor( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Constructor dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Constructor dafnyValue + ) { Constructor.Builder nativeBuilder = Constructor.builder(); nativeBuilder.parts(ToNative.ConstructorPartList(dafnyValue.dtor_parts())); return nativeBuilder.build(); } public static ConstructorPart ConstructorPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ConstructorPart dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ConstructorPart dafnyValue + ) { ConstructorPart.Builder nativeBuilder = ConstructorPart.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); nativeBuilder.required((dafnyValue.dtor_required())); return nativeBuilder.build(); } public static CreateDynamoDbEncryptionBranchKeyIdSupplierInput CreateDynamoDbEncryptionBranchKeyIdSupplierInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue) { - CreateDynamoDbEncryptionBranchKeyIdSupplierInput.Builder nativeBuilder = CreateDynamoDbEncryptionBranchKeyIdSupplierInput.builder(); - nativeBuilder.ddbKeyBranchKeyIdSupplier(ToNative.DynamoDbKeyBranchKeyIdSupplier(dafnyValue.dtor_ddbKeyBranchKeyIdSupplier())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue + ) { + CreateDynamoDbEncryptionBranchKeyIdSupplierInput.Builder nativeBuilder = + CreateDynamoDbEncryptionBranchKeyIdSupplierInput.builder(); + nativeBuilder.ddbKeyBranchKeyIdSupplier( + ToNative.DynamoDbKeyBranchKeyIdSupplier( + dafnyValue.dtor_ddbKeyBranchKeyIdSupplier() + ) + ); return nativeBuilder.build(); } public static CreateDynamoDbEncryptionBranchKeyIdSupplierOutput CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput dafnyValue) { - CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.Builder nativeBuilder = CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.builder(); - nativeBuilder.branchKeyIdSupplier(software.amazon.cryptography.materialproviders.ToNative.BranchKeyIdSupplier(dafnyValue.dtor_branchKeyIdSupplier())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput dafnyValue + ) { + CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.Builder nativeBuilder = + CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.builder(); + nativeBuilder.branchKeyIdSupplier( + software.amazon.cryptography.materialproviders.ToNative.BranchKeyIdSupplier( + dafnyValue.dtor_branchKeyIdSupplier() + ) + ); return nativeBuilder.build(); } public static DynamoDbEncryptionConfig DynamoDbEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue) { - DynamoDbEncryptionConfig.Builder nativeBuilder = DynamoDbEncryptionConfig.builder(); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue + ) { + DynamoDbEncryptionConfig.Builder nativeBuilder = + DynamoDbEncryptionConfig.builder(); return nativeBuilder.build(); } public static DynamoDbTableEncryptionConfig DynamoDbTableEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTableEncryptionConfig dafnyValue) { - DynamoDbTableEncryptionConfig.Builder nativeBuilder = DynamoDbTableEncryptionConfig.builder(); - nativeBuilder.logicalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_logicalTableName())); - nativeBuilder.partitionKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_partitionKeyName())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTableEncryptionConfig dafnyValue + ) { + DynamoDbTableEncryptionConfig.Builder nativeBuilder = + DynamoDbTableEncryptionConfig.builder(); + nativeBuilder.logicalTableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_logicalTableName() + ) + ); + nativeBuilder.partitionKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_partitionKeyName() + ) + ); if (dafnyValue.dtor_sortKeyName().is_Some()) { - nativeBuilder.sortKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_sortKeyName().dtor_value())); + nativeBuilder.sortKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_sortKeyName().dtor_value() + ) + ); } if (dafnyValue.dtor_search().is_Some()) { - nativeBuilder.search(ToNative.SearchConfig(dafnyValue.dtor_search().dtor_value())); + nativeBuilder.search( + ToNative.SearchConfig(dafnyValue.dtor_search().dtor_value()) + ); } - nativeBuilder.attributeActionsOnEncrypt(ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); + nativeBuilder.attributeActionsOnEncrypt( + ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt()) + ); if (dafnyValue.dtor_allowedUnsignedAttributes().is_Some()) { - nativeBuilder.allowedUnsignedAttributes(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList(dafnyValue.dtor_allowedUnsignedAttributes().dtor_value())); + nativeBuilder.allowedUnsignedAttributes( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList( + dafnyValue.dtor_allowedUnsignedAttributes().dtor_value() + ) + ); } if (dafnyValue.dtor_allowedUnsignedAttributePrefix().is_Some()) { - nativeBuilder.allowedUnsignedAttributePrefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value())); + nativeBuilder.allowedUnsignedAttributePrefix( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value() + ) + ); } if (dafnyValue.dtor_algorithmSuiteId().is_Some()) { - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value())); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId().dtor_value() + ) + ); } if (dafnyValue.dtor_keyring().is_Some()) { - nativeBuilder.keyring(software.amazon.cryptography.materialproviders.ToNative.Keyring(dafnyValue.dtor_keyring().dtor_value())); + nativeBuilder.keyring( + software.amazon.cryptography.materialproviders.ToNative.Keyring( + dafnyValue.dtor_keyring().dtor_value() + ) + ); } if (dafnyValue.dtor_cmm().is_Some()) { - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm().dtor_value())); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm().dtor_value() + ) + ); } if (dafnyValue.dtor_legacyOverride().is_Some()) { - nativeBuilder.legacyOverride(ToNative.LegacyOverride(dafnyValue.dtor_legacyOverride().dtor_value())); + nativeBuilder.legacyOverride( + ToNative.LegacyOverride(dafnyValue.dtor_legacyOverride().dtor_value()) + ); } if (dafnyValue.dtor_plaintextOverride().is_Some()) { - nativeBuilder.plaintextOverride(ToNative.PlaintextOverride(dafnyValue.dtor_plaintextOverride().dtor_value())); + nativeBuilder.plaintextOverride( + ToNative.PlaintextOverride( + dafnyValue.dtor_plaintextOverride().dtor_value() + ) + ); } return nativeBuilder.build(); } public static DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue) { - DynamoDbTablesEncryptionConfig.Builder nativeBuilder = DynamoDbTablesEncryptionConfig.builder(); - nativeBuilder.tableEncryptionConfigs(ToNative.DynamoDbTableEncryptionConfigList(dafnyValue.dtor_tableEncryptionConfigs())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue + ) { + DynamoDbTablesEncryptionConfig.Builder nativeBuilder = + DynamoDbTablesEncryptionConfig.builder(); + nativeBuilder.tableEncryptionConfigs( + ToNative.DynamoDbTableEncryptionConfigList( + dafnyValue.dtor_tableEncryptionConfigs() + ) + ); return nativeBuilder.build(); } public static EncryptedPart EncryptedPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedPart dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedPart dafnyValue + ) { EncryptedPart.Builder nativeBuilder = EncryptedPart.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); - nativeBuilder.prefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_prefix())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); + nativeBuilder.prefix( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_prefix() + ) + ); return nativeBuilder.build(); } public static GetBranchKeyIdFromDdbKeyInput GetBranchKeyIdFromDdbKeyInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyValue) { - GetBranchKeyIdFromDdbKeyInput.Builder nativeBuilder = GetBranchKeyIdFromDdbKeyInput.builder(); - nativeBuilder.ddbKey(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Key(dafnyValue.dtor_ddbKey())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyInput dafnyValue + ) { + GetBranchKeyIdFromDdbKeyInput.Builder nativeBuilder = + GetBranchKeyIdFromDdbKeyInput.builder(); + nativeBuilder.ddbKey( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Key( + dafnyValue.dtor_ddbKey() + ) + ); return nativeBuilder.build(); } public static GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKeyOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput dafnyValue) { - GetBranchKeyIdFromDdbKeyOutput.Builder nativeBuilder = GetBranchKeyIdFromDdbKeyOutput.builder(); - nativeBuilder.branchKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyId())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput dafnyValue + ) { + GetBranchKeyIdFromDdbKeyOutput.Builder nativeBuilder = + GetBranchKeyIdFromDdbKeyOutput.builder(); + nativeBuilder.branchKeyId( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_branchKeyId() + ) + ); return nativeBuilder.build(); } public static GetPrefix GetPrefix( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetPrefix dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetPrefix dafnyValue + ) { GetPrefix.Builder nativeBuilder = GetPrefix.builder(); nativeBuilder.length((dafnyValue.dtor_length())); return nativeBuilder.build(); } public static GetSegment GetSegment( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegment dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegment dafnyValue + ) { GetSegment.Builder nativeBuilder = GetSegment.builder(); - nativeBuilder.split(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_split())); + nativeBuilder.split( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_split() + ) + ); nativeBuilder.index((dafnyValue.dtor_index())); return nativeBuilder.build(); } public static GetSegments GetSegments( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegments dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSegments dafnyValue + ) { GetSegments.Builder nativeBuilder = GetSegments.builder(); - nativeBuilder.split(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_split())); + nativeBuilder.split( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_split() + ) + ); nativeBuilder.low((dafnyValue.dtor_low())); nativeBuilder.high((dafnyValue.dtor_high())); return nativeBuilder.build(); } public static GetSubstring GetSubstring( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSubstring dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSubstring dafnyValue + ) { GetSubstring.Builder nativeBuilder = GetSubstring.builder(); nativeBuilder.low((dafnyValue.dtor_low())); nativeBuilder.high((dafnyValue.dtor_high())); @@ -286,135 +448,217 @@ public static GetSubstring GetSubstring( } public static GetSuffix GetSuffix( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSuffix dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetSuffix dafnyValue + ) { GetSuffix.Builder nativeBuilder = GetSuffix.builder(); nativeBuilder.length((dafnyValue.dtor_length())); return nativeBuilder.build(); } public static Insert Insert( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Insert dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Insert dafnyValue + ) { Insert.Builder nativeBuilder = Insert.builder(); - nativeBuilder.literal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_literal())); + nativeBuilder.literal( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_literal() + ) + ); return nativeBuilder.build(); } public static LegacyOverride LegacyOverride( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyOverride dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyOverride dafnyValue + ) { LegacyOverride.Builder nativeBuilder = LegacyOverride.builder(); nativeBuilder.policy(ToNative.LegacyPolicy(dafnyValue.dtor_policy())); - nativeBuilder.encryptor(ToNative.LegacyDynamoDbEncryptor(dafnyValue.dtor_encryptor())); - nativeBuilder.attributeActionsOnEncrypt(ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); + nativeBuilder.encryptor( + ToNative.LegacyDynamoDbEncryptor(dafnyValue.dtor_encryptor()) + ); + nativeBuilder.attributeActionsOnEncrypt( + ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt()) + ); if (dafnyValue.dtor_defaultAttributeFlag().is_Some()) { - nativeBuilder.defaultAttributeFlag(software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.CryptoAction(dafnyValue.dtor_defaultAttributeFlag().dtor_value())); + nativeBuilder.defaultAttributeFlag( + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.CryptoAction( + dafnyValue.dtor_defaultAttributeFlag().dtor_value() + ) + ); } return nativeBuilder.build(); } public static Lower Lower( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Lower dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Lower dafnyValue + ) { Lower.Builder nativeBuilder = Lower.builder(); return nativeBuilder.build(); } public static MultiKeyStore MultiKeyStore( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.MultiKeyStore dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.MultiKeyStore dafnyValue + ) { MultiKeyStore.Builder nativeBuilder = MultiKeyStore.builder(); - nativeBuilder.keyFieldName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyFieldName())); + nativeBuilder.keyFieldName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_keyFieldName() + ) + ); nativeBuilder.cacheTTL((dafnyValue.dtor_cacheTTL())); if (dafnyValue.dtor_cache().is_Some()) { - nativeBuilder.cache(software.amazon.cryptography.materialproviders.ToNative.CacheType(dafnyValue.dtor_cache().dtor_value())); + nativeBuilder.cache( + software.amazon.cryptography.materialproviders.ToNative.CacheType( + dafnyValue.dtor_cache().dtor_value() + ) + ); } return nativeBuilder.build(); } public static PartOnly PartOnly( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PartOnly dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PartOnly dafnyValue + ) { PartOnly.Builder nativeBuilder = PartOnly.builder(); return nativeBuilder.build(); } public static SearchConfig SearchConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SearchConfig dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SearchConfig dafnyValue + ) { SearchConfig.Builder nativeBuilder = SearchConfig.builder(); - nativeBuilder.versions(ToNative.BeaconVersionList(dafnyValue.dtor_versions())); + nativeBuilder.versions( + ToNative.BeaconVersionList(dafnyValue.dtor_versions()) + ); nativeBuilder.writeVersion((dafnyValue.dtor_writeVersion())); return nativeBuilder.build(); } public static Shared Shared( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Shared dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Shared dafnyValue + ) { Shared.Builder nativeBuilder = Shared.builder(); - nativeBuilder.other(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_other())); + nativeBuilder.other( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_other() + ) + ); return nativeBuilder.build(); } public static SharedSet SharedSet( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SharedSet dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SharedSet dafnyValue + ) { SharedSet.Builder nativeBuilder = SharedSet.builder(); - nativeBuilder.other(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_other())); + nativeBuilder.other( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_other() + ) + ); return nativeBuilder.build(); } public static SignedPart SignedPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SignedPart dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SignedPart dafnyValue + ) { SignedPart.Builder nativeBuilder = SignedPart.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); - nativeBuilder.prefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_prefix())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); + nativeBuilder.prefix( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_prefix() + ) + ); if (dafnyValue.dtor_loc().is_Some()) { - nativeBuilder.loc(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_loc().dtor_value())); + nativeBuilder.loc( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_loc().dtor_value() + ) + ); } return nativeBuilder.build(); } public static SingleKeyStore SingleKeyStore( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SingleKeyStore dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SingleKeyStore dafnyValue + ) { SingleKeyStore.Builder nativeBuilder = SingleKeyStore.builder(); - nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId())); + nativeBuilder.keyId( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_keyId() + ) + ); nativeBuilder.cacheTTL((dafnyValue.dtor_cacheTTL())); return nativeBuilder.build(); } public static StandardBeacon StandardBeacon( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.StandardBeacon dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.StandardBeacon dafnyValue + ) { StandardBeacon.Builder nativeBuilder = StandardBeacon.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); nativeBuilder.length((dafnyValue.dtor_length())); if (dafnyValue.dtor_loc().is_Some()) { - nativeBuilder.loc(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_loc().dtor_value())); + nativeBuilder.loc( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_loc().dtor_value() + ) + ); } if (dafnyValue.dtor_style().is_Some()) { - nativeBuilder.style(ToNative.BeaconStyle(dafnyValue.dtor_style().dtor_value())); + nativeBuilder.style( + ToNative.BeaconStyle(dafnyValue.dtor_style().dtor_value()) + ); } return nativeBuilder.build(); } public static Upper Upper( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Upper dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Upper dafnyValue + ) { Upper.Builder nativeBuilder = Upper.builder(); return nativeBuilder.build(); } public static VirtualField VirtualField( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualField dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualField dafnyValue + ) { VirtualField.Builder nativeBuilder = VirtualField.builder(); - nativeBuilder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); + nativeBuilder.name( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_name() + ) + ); nativeBuilder.parts(ToNative.VirtualPartList(dafnyValue.dtor_parts())); return nativeBuilder.build(); } public static VirtualPart VirtualPart( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualPart dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualPart dafnyValue + ) { VirtualPart.Builder nativeBuilder = VirtualPart.builder(); - nativeBuilder.loc(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_loc())); + nativeBuilder.loc( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_loc() + ) + ); if (dafnyValue.dtor_trans().is_Some()) { - nativeBuilder.trans(ToNative.VirtualTransformList(dafnyValue.dtor_trans().dtor_value())); + nativeBuilder.trans( + ToNative.VirtualTransformList(dafnyValue.dtor_trans().dtor_value()) + ); } return nativeBuilder.build(); } public static LegacyPolicy LegacyPolicy( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.LegacyPolicy dafnyValue + ) { if (dafnyValue.is_FORCE__LEGACY__ENCRYPT__ALLOW__LEGACY__DECRYPT()) { return LegacyPolicy.FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT; } @@ -424,11 +668,15 @@ public static LegacyPolicy LegacyPolicy( if (dafnyValue.is_FORBID__LEGACY__ENCRYPT__FORBID__LEGACY__DECRYPT()) { return LegacyPolicy.FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyPolicy matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.dynamodb.model.LegacyPolicy matches the input : " + + dafnyValue + ); } public static PlaintextOverride PlaintextOverride( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.PlaintextOverride dafnyValue + ) { if (dafnyValue.is_FORCE__PLAINTEXT__WRITE__ALLOW__PLAINTEXT__READ()) { return PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ; } @@ -438,11 +686,15 @@ public static PlaintextOverride PlaintextOverride( if (dafnyValue.is_FORBID__PLAINTEXT__WRITE__FORBID__PLAINTEXT__READ()) { return PlaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PlaintextOverride matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.dynamodb.model.PlaintextOverride matches the input : " + + dafnyValue + ); } public static BeaconKeySource BeaconKeySource( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource dafnyValue + ) { BeaconKeySource.Builder nativeBuilder = BeaconKeySource.builder(); if (dafnyValue.is_single()) { nativeBuilder.single(ToNative.SingleKeyStore(dafnyValue.dtor_single())); @@ -454,7 +706,8 @@ public static BeaconKeySource BeaconKeySource( } public static BeaconStyle BeaconStyle( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconStyle dafnyValue + ) { BeaconStyle.Builder nativeBuilder = BeaconStyle.builder(); if (dafnyValue.is_partOnly()) { nativeBuilder.partOnly(ToNative.PartOnly(dafnyValue.dtor_partOnly())); @@ -472,7 +725,8 @@ public static BeaconStyle BeaconStyle( } public static VirtualTransform VirtualTransform( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform dafnyValue + ) { VirtualTransform.Builder nativeBuilder = VirtualTransform.builder(); if (dafnyValue.is_upper()) { nativeBuilder.upper(ToNative.Upper(dafnyValue.dtor_upper())); @@ -490,7 +744,9 @@ public static VirtualTransform VirtualTransform( nativeBuilder.suffix(ToNative.GetSuffix(dafnyValue.dtor_suffix())); } if (dafnyValue.is_substring()) { - nativeBuilder.substring(ToNative.GetSubstring(dafnyValue.dtor_substring())); + nativeBuilder.substring( + ToNative.GetSubstring(dafnyValue.dtor_substring()) + ); } if (dafnyValue.is_segment()) { nativeBuilder.segment(ToNative.GetSegment(dafnyValue.dtor_segment())); @@ -502,93 +758,147 @@ public static VirtualTransform VirtualTransform( } public static List BeaconVersionList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconVersion + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::BeaconVersion); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::BeaconVersion + ); } public static List CompoundBeaconList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CompoundBeacon + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::CompoundBeacon); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::CompoundBeacon + ); } public static List ConstructorList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Constructor + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::Constructor); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::Constructor + ); } public static List ConstructorPartList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ConstructorPart + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::ConstructorPart); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::ConstructorPart + ); } public static List EncryptedPartsList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedPart + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::EncryptedPart); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::EncryptedPart + ); } public static List SignedPartsList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.SignedPart + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::SignedPart); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::SignedPart + ); } public static List StandardBeaconList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.StandardBeacon + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::StandardBeacon); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::StandardBeacon + ); } public static List VirtualFieldList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualField + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualField); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualField + ); } public static List VirtualPartList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualPart + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualPart); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualPart + ); } public static List VirtualTransformList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.VirtualTransform + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualTransform); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::VirtualTransform + ); } public static Map AttributeActions( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoAction); - } - - public static Map DynamoDbTableEncryptionConfigList( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTableEncryptionConfig> dafnyValue) { + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoAction + ); + } + + public static Map< + String, + DynamoDbTableEncryptionConfig + > DynamoDbTableEncryptionConfigList( + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTableEncryptionConfig + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::DynamoDbTableEncryptionConfig); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::DynamoDbTableEncryptionConfig + ); } public static IDynamoDbKeyBranchKeyIdSupplier DynamoDbKeyBranchKeyIdSupplier( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier dafnyValue + ) { if (dafnyValue instanceof DynamoDbKeyBranchKeyIdSupplier.NativeWrapper) { return ((DynamoDbKeyBranchKeyIdSupplier.NativeWrapper) dafnyValue)._impl; } @@ -596,14 +906,17 @@ public static IDynamoDbKeyBranchKeyIdSupplier DynamoDbKeyBranchKeyIdSupplier( } public static ILegacyDynamoDbEncryptor LegacyDynamoDbEncryptor( - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor dafnyValue + ) { if (dafnyValue instanceof LegacyDynamoDbEncryptor.NativeWrapper) { return ((LegacyDynamoDbEncryptor.NativeWrapper) dafnyValue)._impl; } return LegacyDynamoDbEncryptor.wrap(dafnyValue); } - public static DynamoDbEncryption DynamoDbEncryption(IDynamoDbEncryptionClient dafnyValue) { + public static DynamoDbEncryption DynamoDbEncryption( + IDynamoDbEncryptionClient dafnyValue + ) { return new DynamoDbEncryption(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java index 227f1ec15..9d842924b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java @@ -6,7 +6,6 @@ import Wrappers_Compile.Result; import java.lang.IllegalArgumentException; import java.util.Objects; -import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.DynamoDbItemEncryptorClient; import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.__default; import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error; import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.IDynamoDbItemEncryptorClient; @@ -17,12 +16,15 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput; public class DynamoDbItemEncryptor { + private final IDynamoDbItemEncryptorClient _impl; protected DynamoDbItemEncryptor(BuilderImpl builder) { DynamoDbItemEncryptorConfig input = builder.DynamoDbItemEncryptorConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue = ToDafny.DynamoDbItemEncryptorConfig(input); - Result result = __default.DynamoDbItemEncryptor(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue = + ToDafny.DynamoDbItemEncryptorConfig(input); + Result result = + __default.DynamoDbItemEncryptor(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -44,8 +46,12 @@ public static Builder builder() { * @return Outputs for decrypting a DynamoDB Item. */ public DecryptItemOutput DecryptItem(DecryptItemInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue = ToDafny.DecryptItemInput(input); - Result result = this._impl.DecryptItem(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue = + ToDafny.DecryptItemInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput, + Error + > result = this._impl.DecryptItem(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -59,8 +65,12 @@ public DecryptItemOutput DecryptItem(DecryptItemInput input) { * @return Outputs for encrypting a DynamoDB Item. */ public EncryptItemOutput EncryptItem(EncryptItemInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue = ToDafny.EncryptItemInput(input); - Result result = this._impl.EncryptItem(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue = + ToDafny.EncryptItemInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput, + Error + > result = this._impl.EncryptItem(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -75,7 +85,9 @@ public interface Builder { /** * @param DynamoDbItemEncryptorConfig The configuration for the client-side encryption of DynamoDB items. */ - Builder DynamoDbItemEncryptorConfig(DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig); + Builder DynamoDbItemEncryptorConfig( + DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig + ); /** * @return The configuration for the client-side encryption of DynamoDB items. @@ -86,13 +98,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder DynamoDbItemEncryptorConfig( - DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig) { + DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig + ) { this.DynamoDbItemEncryptorConfig = DynamoDbItemEncryptorConfig; return this; } @@ -102,8 +115,10 @@ public DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig() { } public DynamoDbItemEncryptor build() { - if (Objects.isNull(this.DynamoDbItemEncryptorConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbItemEncryptorConfig`"); + if (Objects.isNull(this.DynamoDbItemEncryptorConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbItemEncryptorConfig`" + ); } return new DynamoDbItemEncryptor(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java index 64b8e4d54..0f6f71e81 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java @@ -32,6 +32,7 @@ import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof DynamoDbItemEncryptorException) { return ToDafny.Error((DynamoDbItemEncryptorException) nativeValue); @@ -50,114 +51,245 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static DecryptItemInput DecryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemInput nativeValue) { - DafnyMap, ? extends AttributeValue> encryptedItem; - encryptedItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.encryptedItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemInput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > encryptedItem; + encryptedItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.encryptedItem() + ); return new DecryptItemInput(encryptedItem); } public static DecryptItemOutput DecryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemOutput nativeValue) { - DafnyMap, ? extends AttributeValue> plaintextItem; - plaintextItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.plaintextItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemOutput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > plaintextItem; + plaintextItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.plaintextItem() + ); Option parsedHeader; - parsedHeader = Objects.nonNull(nativeValue.parsedHeader()) ? - Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) + parsedHeader = + Objects.nonNull(nativeValue.parsedHeader()) + ? Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) : Option.create_None(); return new DecryptItemOutput(plaintextItem, parsedHeader); } public static DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DynamoDbItemEncryptorConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DynamoDbItemEncryptorConfig nativeValue + ) { DafnySequence logicalTableName; - logicalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.logicalTableName()); + logicalTableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.logicalTableName() + ); DafnySequence partitionKeyName; - partitionKeyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.partitionKeyName()); + partitionKeyName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.partitionKeyName() + ); Option> sortKeyName; - sortKeyName = Objects.nonNull(nativeValue.sortKeyName()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sortKeyName())) + sortKeyName = + Objects.nonNull(nativeValue.sortKeyName()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.sortKeyName() + ) + ) : Option.create_None(); - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); - Option>> allowedUnsignedAttributes; - allowedUnsignedAttributes = (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && nativeValue.allowedUnsignedAttributes().size() > 0) ? - Option.create_Some(software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList(nativeValue.allowedUnsignedAttributes())) + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions( + nativeValue.attributeActionsOnEncrypt() + ); + Option< + DafnySequence> + > allowedUnsignedAttributes; + allowedUnsignedAttributes = + (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && + nativeValue.allowedUnsignedAttributes().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList( + nativeValue.allowedUnsignedAttributes() + ) + ) : Option.create_None(); Option> allowedUnsignedAttributePrefix; - allowedUnsignedAttributePrefix = Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.allowedUnsignedAttributePrefix())) + allowedUnsignedAttributePrefix = + Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.allowedUnsignedAttributePrefix() + ) + ) : Option.create_None(); Option algorithmSuiteId; - algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId())) + algorithmSuiteId = + Objects.nonNull(nativeValue.algorithmSuiteId()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ) + ) : Option.create_None(); Option keyring; - keyring = Objects.nonNull(nativeValue.keyring()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.Keyring(nativeValue.keyring())) + keyring = + Objects.nonNull(nativeValue.keyring()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.Keyring( + nativeValue.keyring() + ) + ) : Option.create_None(); Option cmm; - cmm = Objects.nonNull(nativeValue.cmm()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm())) + cmm = + Objects.nonNull(nativeValue.cmm()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ) + ) : Option.create_None(); Option legacyOverride; - legacyOverride = Objects.nonNull(nativeValue.legacyOverride()) ? - Option.create_Some(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.LegacyOverride(nativeValue.legacyOverride())) + legacyOverride = + Objects.nonNull(nativeValue.legacyOverride()) + ? Option.create_Some( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.LegacyOverride( + nativeValue.legacyOverride() + ) + ) : Option.create_None(); Option plaintextOverride; - plaintextOverride = Objects.nonNull(nativeValue.plaintextOverride()) ? - Option.create_Some(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.PlaintextOverride(nativeValue.plaintextOverride())) + plaintextOverride = + Objects.nonNull(nativeValue.plaintextOverride()) + ? Option.create_Some( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.PlaintextOverride( + nativeValue.plaintextOverride() + ) + ) : Option.create_None(); - return new DynamoDbItemEncryptorConfig(logicalTableName, partitionKeyName, sortKeyName, attributeActionsOnEncrypt, allowedUnsignedAttributes, allowedUnsignedAttributePrefix, algorithmSuiteId, keyring, cmm, legacyOverride, plaintextOverride); + return new DynamoDbItemEncryptorConfig( + logicalTableName, + partitionKeyName, + sortKeyName, + attributeActionsOnEncrypt, + allowedUnsignedAttributes, + allowedUnsignedAttributePrefix, + algorithmSuiteId, + keyring, + cmm, + legacyOverride, + plaintextOverride + ); } public static EncryptItemInput EncryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemInput nativeValue) { - DafnyMap, ? extends AttributeValue> plaintextItem; - plaintextItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.plaintextItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemInput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > plaintextItem; + plaintextItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.plaintextItem() + ); return new EncryptItemInput(plaintextItem); } public static EncryptItemOutput EncryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput nativeValue) { - DafnyMap, ? extends AttributeValue> encryptedItem; - encryptedItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.encryptedItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > encryptedItem; + encryptedItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.encryptedItem() + ); Option parsedHeader; - parsedHeader = Objects.nonNull(nativeValue.parsedHeader()) ? - Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) + parsedHeader = + Objects.nonNull(nativeValue.parsedHeader()) + ? Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) : Option.create_None(); return new EncryptItemOutput(encryptedItem, parsedHeader); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader nativeValue) { - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions( + nativeValue.attributeActionsOnEncrypt() + ); DBEAlgorithmSuiteId algorithmSuiteId; - algorithmSuiteId = software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId()); + algorithmSuiteId = + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ); DafnySequence encryptedDataKeys; - encryptedDataKeys = software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys()); - DafnyMap, ? extends DafnySequence> storedEncryptionContext; - storedEncryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.storedEncryptionContext()); - return new ParsedHeader(attributeActionsOnEncrypt, algorithmSuiteId, encryptedDataKeys, storedEncryptionContext); + encryptedDataKeys = + software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList( + nativeValue.encryptedDataKeys() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > storedEncryptionContext; + storedEncryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.storedEncryptionContext() + ); + return new ParsedHeader( + attributeActionsOnEncrypt, + algorithmSuiteId, + encryptedDataKeys, + storedEncryptionContext + ); } public static Error Error(DynamoDbItemEncryptorException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_DynamoDbItemEncryptorException(message); } public static IDynamoDbItemEncryptorClient DynamoDbItemEncryptor( - DynamoDbItemEncryptor nativeValue) { + DynamoDbItemEncryptor nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java index eca5d5e0b..f2e996b6b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java @@ -20,6 +20,7 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -29,17 +30,29 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static DynamoDbItemEncryptorException Error( - Error_DynamoDbItemEncryptorException dafnyValue) { - DynamoDbItemEncryptorException.Builder nativeBuilder = DynamoDbItemEncryptorException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + Error_DynamoDbItemEncryptorException dafnyValue + ) { + DynamoDbItemEncryptorException.Builder nativeBuilder = + DynamoDbItemEncryptorException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } @@ -54,19 +67,29 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_AwsCryptographyPrimitives()) { - return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives()); + return software.amazon.cryptography.primitives.ToNative.Error( + dafnyValue.dtor_AwsCryptographyPrimitives() + ); } if (dafnyValue.is_ComAmazonawsDynamodb()) { - return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsDynamodb()); + return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error( + dafnyValue.dtor_ComAmazonawsDynamodb() + ); } if (dafnyValue.is_AwsCryptographyMaterialProviders()) { - return software.amazon.cryptography.materialproviders.ToNative.Error(dafnyValue.dtor_AwsCryptographyMaterialProviders()); + return software.amazon.cryptography.materialproviders.ToNative.Error( + dafnyValue.dtor_AwsCryptographyMaterialProviders() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkStructuredEncryption()) { - return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption()); + return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkDynamoDb()) { - return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb()); + return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -74,84 +97,172 @@ public static RuntimeException Error(Error dafnyValue) { } public static DecryptItemInput DecryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue + ) { DecryptItemInput.Builder nativeBuilder = DecryptItemInput.builder(); - nativeBuilder.encryptedItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_encryptedItem())); + nativeBuilder.encryptedItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_encryptedItem() + ) + ); return nativeBuilder.build(); } public static DecryptItemOutput DecryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput dafnyValue + ) { DecryptItemOutput.Builder nativeBuilder = DecryptItemOutput.builder(); - nativeBuilder.plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_plaintextItem())); + nativeBuilder.plaintextItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_plaintextItem() + ) + ); if (dafnyValue.dtor_parsedHeader().is_Some()) { - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value())); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value()) + ); } return nativeBuilder.build(); } public static DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue) { - DynamoDbItemEncryptorConfig.Builder nativeBuilder = DynamoDbItemEncryptorConfig.builder(); - nativeBuilder.logicalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_logicalTableName())); - nativeBuilder.partitionKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_partitionKeyName())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue + ) { + DynamoDbItemEncryptorConfig.Builder nativeBuilder = + DynamoDbItemEncryptorConfig.builder(); + nativeBuilder.logicalTableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_logicalTableName() + ) + ); + nativeBuilder.partitionKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_partitionKeyName() + ) + ); if (dafnyValue.dtor_sortKeyName().is_Some()) { - nativeBuilder.sortKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_sortKeyName().dtor_value())); + nativeBuilder.sortKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_sortKeyName().dtor_value() + ) + ); } - nativeBuilder.attributeActionsOnEncrypt(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); + nativeBuilder.attributeActionsOnEncrypt( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions( + dafnyValue.dtor_attributeActionsOnEncrypt() + ) + ); if (dafnyValue.dtor_allowedUnsignedAttributes().is_Some()) { - nativeBuilder.allowedUnsignedAttributes(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList(dafnyValue.dtor_allowedUnsignedAttributes().dtor_value())); + nativeBuilder.allowedUnsignedAttributes( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList( + dafnyValue.dtor_allowedUnsignedAttributes().dtor_value() + ) + ); } if (dafnyValue.dtor_allowedUnsignedAttributePrefix().is_Some()) { - nativeBuilder.allowedUnsignedAttributePrefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value())); + nativeBuilder.allowedUnsignedAttributePrefix( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value() + ) + ); } if (dafnyValue.dtor_algorithmSuiteId().is_Some()) { - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value())); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId().dtor_value() + ) + ); } if (dafnyValue.dtor_keyring().is_Some()) { - nativeBuilder.keyring(software.amazon.cryptography.materialproviders.ToNative.Keyring(dafnyValue.dtor_keyring().dtor_value())); + nativeBuilder.keyring( + software.amazon.cryptography.materialproviders.ToNative.Keyring( + dafnyValue.dtor_keyring().dtor_value() + ) + ); } if (dafnyValue.dtor_cmm().is_Some()) { - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm().dtor_value())); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm().dtor_value() + ) + ); } if (dafnyValue.dtor_legacyOverride().is_Some()) { - nativeBuilder.legacyOverride(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.LegacyOverride(dafnyValue.dtor_legacyOverride().dtor_value())); + nativeBuilder.legacyOverride( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.LegacyOverride( + dafnyValue.dtor_legacyOverride().dtor_value() + ) + ); } if (dafnyValue.dtor_plaintextOverride().is_Some()) { - nativeBuilder.plaintextOverride(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.PlaintextOverride(dafnyValue.dtor_plaintextOverride().dtor_value())); + nativeBuilder.plaintextOverride( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.PlaintextOverride( + dafnyValue.dtor_plaintextOverride().dtor_value() + ) + ); } return nativeBuilder.build(); } public static EncryptItemInput EncryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue + ) { EncryptItemInput.Builder nativeBuilder = EncryptItemInput.builder(); - nativeBuilder.plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_plaintextItem())); + nativeBuilder.plaintextItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_plaintextItem() + ) + ); return nativeBuilder.build(); } public static EncryptItemOutput EncryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput dafnyValue + ) { EncryptItemOutput.Builder nativeBuilder = EncryptItemOutput.builder(); - nativeBuilder.encryptedItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_encryptedItem())); + nativeBuilder.encryptedItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_encryptedItem() + ) + ); if (dafnyValue.dtor_parsedHeader().is_Some()) { - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value())); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value()) + ); } return nativeBuilder.build(); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.ParsedHeader dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.ParsedHeader dafnyValue + ) { ParsedHeader.Builder nativeBuilder = ParsedHeader.builder(); - nativeBuilder.attributeActionsOnEncrypt(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId())); - nativeBuilder.encryptedDataKeys(software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys())); - nativeBuilder.storedEncryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_storedEncryptionContext())); + nativeBuilder.attributeActionsOnEncrypt( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions( + dafnyValue.dtor_attributeActionsOnEncrypt() + ) + ); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId() + ) + ); + nativeBuilder.encryptedDataKeys( + software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList( + dafnyValue.dtor_encryptedDataKeys() + ) + ); + nativeBuilder.storedEncryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_storedEncryptionContext() + ) + ); return nativeBuilder.build(); } public static DynamoDbItemEncryptor DynamoDbItemEncryptor( - IDynamoDbItemEncryptorClient dafnyValue) { + IDynamoDbItemEncryptorClient dafnyValue + ) { return new DynamoDbItemEncryptor(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java index b9a2fd5cf..1bb59f8f4 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java @@ -6,6 +6,7 @@ import java.util.List; public class CollectionOfErrors extends RuntimeException { + /** * The list of Exceptions encountered. */ @@ -90,14 +91,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected List list; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CollectionOfErrors model) { this.cause = model.getCause(); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemInput.java index b98a9da19..b9668a63f 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemInput.java @@ -11,6 +11,7 @@ * Inputs for decrypting a DynamoDB Item. */ public class DecryptItemInput { + /** * The encrypted DynamoDB item to decrypt. */ @@ -50,10 +51,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map encryptedItem; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DecryptItemInput model) { this.encryptedItem = model.encryptedItem(); @@ -69,8 +70,10 @@ public Map encryptedItem() { } public DecryptItemInput build() { - if (Objects.isNull(this.encryptedItem())) { - throw new IllegalArgumentException("Missing value for required field `encryptedItem`"); + if (Objects.isNull(this.encryptedItem())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedItem`" + ); } return new DecryptItemInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemOutput.java index 7802fc882..381783aac 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DecryptItemOutput.java @@ -11,6 +11,7 @@ * Outputs for decrypting a DynamoDB Item. */ public class DecryptItemOutput { + /** * The decrypted DynamoDB item. */ @@ -73,12 +74,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map plaintextItem; protected ParsedHeader parsedHeader; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DecryptItemOutput model) { this.plaintextItem = model.plaintextItem(); @@ -104,8 +105,10 @@ public ParsedHeader parsedHeader() { } public DecryptItemOutput build() { - if (Objects.isNull(this.plaintextItem())) { - throw new IllegalArgumentException("Missing value for required field `plaintextItem`"); + if (Objects.isNull(this.plaintextItem())) { + throw new IllegalArgumentException( + "Missing value for required field `plaintextItem`" + ); } return new DecryptItemOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorConfig.java index 2572edfbd..cc05ea694 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorConfig.java @@ -19,6 +19,7 @@ * The configuration for the client-side encryption of DynamoDB items. */ public class DynamoDbItemEncryptorConfig { + /** * The logical table name for this table. This is the name that is cryptographically bound with your data. This can be the same as the actual DynamoDB table name. It's purpose is to be distinct from the DynamoDB table name so that the data may still be authenticated if being read from different (but logically similar) tables, such as a backup table. */ @@ -80,7 +81,8 @@ protected DynamoDbItemEncryptorConfig(BuilderImpl builder) { this.sortKeyName = builder.sortKeyName(); this.attributeActionsOnEncrypt = builder.attributeActionsOnEncrypt(); this.allowedUnsignedAttributes = builder.allowedUnsignedAttributes(); - this.allowedUnsignedAttributePrefix = builder.allowedUnsignedAttributePrefix(); + this.allowedUnsignedAttributePrefix = + builder.allowedUnsignedAttributePrefix(); this.algorithmSuiteId = builder.algorithmSuiteId(); this.keyring = builder.keyring(); this.cmm = builder.cmm(); @@ -207,7 +209,9 @@ public interface Builder { /** * @param attributeActionsOnEncrypt A map that describes what attributes should be encrypted and/or signed on encrypt. This map must contain all attributes that might be encountered during encryption. */ - Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt); + Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ); /** * @return A map that describes what attributes should be encrypted and/or signed on encrypt. This map must contain all attributes that might be encountered during encryption. @@ -227,7 +231,9 @@ public interface Builder { /** * @param allowedUnsignedAttributePrefix A prefix such that, if during decryption any attribute has a name with this prefix, it is treated as unsigned. */ - Builder allowedUnsignedAttributePrefix(String allowedUnsignedAttributePrefix); + Builder allowedUnsignedAttributePrefix( + String allowedUnsignedAttributePrefix + ); /** * @return A prefix such that, if during decryption any attribute has a name with this prefix, it is treated as unsigned. @@ -288,6 +294,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String logicalTableName; protected String partitionKeyName; @@ -310,8 +317,7 @@ static class BuilderImpl implements Builder { protected PlaintextOverride plaintextOverride; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbItemEncryptorConfig model) { this.logicalTableName = model.logicalTableName(); @@ -319,7 +325,8 @@ protected BuilderImpl(DynamoDbItemEncryptorConfig model) { this.sortKeyName = model.sortKeyName(); this.attributeActionsOnEncrypt = model.attributeActionsOnEncrypt(); this.allowedUnsignedAttributes = model.allowedUnsignedAttributes(); - this.allowedUnsignedAttributePrefix = model.allowedUnsignedAttributePrefix(); + this.allowedUnsignedAttributePrefix = + model.allowedUnsignedAttributePrefix(); this.algorithmSuiteId = model.algorithmSuiteId(); this.keyring = model.keyring(); this.cmm = model.cmm(); @@ -354,7 +361,9 @@ public String sortKeyName() { return this.sortKeyName; } - public Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt) { + public Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ) { this.attributeActionsOnEncrypt = attributeActionsOnEncrypt; return this; } @@ -363,7 +372,9 @@ public Map attributeActionsOnEncrypt() { return this.attributeActionsOnEncrypt; } - public Builder allowedUnsignedAttributes(List allowedUnsignedAttributes) { + public Builder allowedUnsignedAttributes( + List allowedUnsignedAttributes + ) { this.allowedUnsignedAttributes = allowedUnsignedAttributes; return this; } @@ -372,7 +383,9 @@ public List allowedUnsignedAttributes() { return this.allowedUnsignedAttributes; } - public Builder allowedUnsignedAttributePrefix(String allowedUnsignedAttributePrefix) { + public Builder allowedUnsignedAttributePrefix( + String allowedUnsignedAttributePrefix + ) { this.allowedUnsignedAttributePrefix = allowedUnsignedAttributePrefix; return this; } @@ -427,29 +440,58 @@ public PlaintextOverride plaintextOverride() { } public DynamoDbItemEncryptorConfig build() { - if (Objects.isNull(this.logicalTableName())) { - throw new IllegalArgumentException("Missing value for required field `logicalTableName`"); + if (Objects.isNull(this.logicalTableName())) { + throw new IllegalArgumentException( + "Missing value for required field `logicalTableName`" + ); } - if (Objects.isNull(this.partitionKeyName())) { - throw new IllegalArgumentException("Missing value for required field `partitionKeyName`"); + if (Objects.isNull(this.partitionKeyName())) { + throw new IllegalArgumentException( + "Missing value for required field `partitionKeyName`" + ); } - if (Objects.nonNull(this.partitionKeyName()) && this.partitionKeyName().length() < 1) { - throw new IllegalArgumentException("The size of `partitionKeyName` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.partitionKeyName()) && + this.partitionKeyName().length() < 1 + ) { + throw new IllegalArgumentException( + "The size of `partitionKeyName` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.partitionKeyName()) && this.partitionKeyName().length() > 255) { - throw new IllegalArgumentException("The size of `partitionKeyName` must be less than or equal to 255"); + if ( + Objects.nonNull(this.partitionKeyName()) && + this.partitionKeyName().length() > 255 + ) { + throw new IllegalArgumentException( + "The size of `partitionKeyName` must be less than or equal to 255" + ); } - if (Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() < 1) { - throw new IllegalArgumentException("The size of `sortKeyName` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() < 1 + ) { + throw new IllegalArgumentException( + "The size of `sortKeyName` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() > 255) { - throw new IllegalArgumentException("The size of `sortKeyName` must be less than or equal to 255"); + if ( + Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() > 255 + ) { + throw new IllegalArgumentException( + "The size of `sortKeyName` must be less than or equal to 255" + ); } - if (Objects.isNull(this.attributeActionsOnEncrypt())) { - throw new IllegalArgumentException("Missing value for required field `attributeActionsOnEncrypt`"); + if (Objects.isNull(this.attributeActionsOnEncrypt())) { + throw new IllegalArgumentException( + "Missing value for required field `attributeActionsOnEncrypt`" + ); } - if (Objects.nonNull(this.allowedUnsignedAttributes()) && this.allowedUnsignedAttributes().size() < 1) { - throw new IllegalArgumentException("The size of `allowedUnsignedAttributes` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.allowedUnsignedAttributes()) && + this.allowedUnsignedAttributes().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `allowedUnsignedAttributes` must be greater than or equal to 1" + ); } return new DynamoDbItemEncryptorConfig(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorException.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorException.java index 304b9c723..2ed05cff1 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorException.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/DynamoDbItemEncryptorException.java @@ -6,6 +6,7 @@ import java.util.Objects; public class DynamoDbItemEncryptorException extends RuntimeException { + protected DynamoDbItemEncryptorException(BuilderImpl builder) { super(messageFromBuilder(builder), builder.cause()); } @@ -67,12 +68,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbItemEncryptorException model) { this.message = model.message(); @@ -98,8 +99,10 @@ public Throwable cause() { } public DynamoDbItemEncryptorException build() { - if (Objects.isNull(this.message())) { - throw new IllegalArgumentException("Missing value for required field `message`"); + if (Objects.isNull(this.message())) { + throw new IllegalArgumentException( + "Missing value for required field `message`" + ); } return new DynamoDbItemEncryptorException(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemInput.java index ae5ae3ec7..ca8ad2b89 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemInput.java @@ -11,6 +11,7 @@ * Inputs for encrypting a DynamoDB Item. */ public class EncryptItemInput { + /** * The DynamoDB item to encrypt. */ @@ -50,10 +51,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map plaintextItem; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(EncryptItemInput model) { this.plaintextItem = model.plaintextItem(); @@ -69,8 +70,10 @@ public Map plaintextItem() { } public EncryptItemInput build() { - if (Objects.isNull(this.plaintextItem())) { - throw new IllegalArgumentException("Missing value for required field `plaintextItem`"); + if (Objects.isNull(this.plaintextItem())) { + throw new IllegalArgumentException( + "Missing value for required field `plaintextItem`" + ); } return new EncryptItemInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemOutput.java index db1046314..62ee535e9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/EncryptItemOutput.java @@ -11,6 +11,7 @@ * Outputs for encrypting a DynamoDB Item. */ public class EncryptItemOutput { + /** * The encrypted DynamoDB item. */ @@ -73,12 +74,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map encryptedItem; protected ParsedHeader parsedHeader; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(EncryptItemOutput model) { this.encryptedItem = model.encryptedItem(); @@ -104,8 +105,10 @@ public ParsedHeader parsedHeader() { } public EncryptItemOutput build() { - if (Objects.isNull(this.encryptedItem())) { - throw new IllegalArgumentException("Missing value for required field `encryptedItem`"); + if (Objects.isNull(this.encryptedItem())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedItem`" + ); } return new EncryptItemOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/OpaqueError.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/OpaqueError.java index 007399ea5..1962ee979 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/OpaqueError.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/OpaqueError.java @@ -4,6 +4,7 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model; public class OpaqueError extends RuntimeException { + /** * The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed. */ @@ -88,14 +89,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected Object obj; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(OpaqueError model) { this.cause = model.getCause(); @@ -131,7 +132,9 @@ public Object obj() { } public OpaqueError build() { - if (this.obj != null && this.cause == null && this.obj instanceof Throwable) { + if ( + this.obj != null && this.cause == null && this.obj instanceof Throwable + ) { this.cause = (Throwable) this.obj; } else if (this.obj == null && this.cause != null) { this.obj = this.cause; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java index 175360f3a..58e09600c 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java @@ -14,6 +14,7 @@ * A parsed version of the header that was written with or read on an encrypted DynamoDB item. */ public class ParsedHeader { + /** * The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. */ @@ -81,7 +82,9 @@ public interface Builder { /** * @param attributeActionsOnEncrypt The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. */ - Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt); + Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ); /** * @return The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. @@ -111,7 +114,9 @@ public interface Builder { /** * @param storedEncryptionContext The portion of the encryption context that was stored in the header of this item. */ - Builder storedEncryptionContext(Map storedEncryptionContext); + Builder storedEncryptionContext( + Map storedEncryptionContext + ); /** * @return The portion of the encryption context that was stored in the header of this item. @@ -122,6 +127,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map attributeActionsOnEncrypt; protected DBEAlgorithmSuiteId algorithmSuiteId; @@ -130,8 +136,7 @@ static class BuilderImpl implements Builder { protected Map storedEncryptionContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ParsedHeader model) { this.attributeActionsOnEncrypt = model.attributeActionsOnEncrypt(); @@ -140,7 +145,9 @@ protected BuilderImpl(ParsedHeader model) { this.storedEncryptionContext = model.storedEncryptionContext(); } - public Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt) { + public Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ) { this.attributeActionsOnEncrypt = attributeActionsOnEncrypt; return this; } @@ -167,7 +174,9 @@ public List encryptedDataKeys() { return this.encryptedDataKeys; } - public Builder storedEncryptionContext(Map storedEncryptionContext) { + public Builder storedEncryptionContext( + Map storedEncryptionContext + ) { this.storedEncryptionContext = storedEncryptionContext; return this; } @@ -177,17 +186,25 @@ public Map storedEncryptionContext() { } public ParsedHeader build() { - if (Objects.isNull(this.attributeActionsOnEncrypt())) { - throw new IllegalArgumentException("Missing value for required field `attributeActionsOnEncrypt`"); + if (Objects.isNull(this.attributeActionsOnEncrypt())) { + throw new IllegalArgumentException( + "Missing value for required field `attributeActionsOnEncrypt`" + ); } - if (Objects.isNull(this.algorithmSuiteId())) { - throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`"); + if (Objects.isNull(this.algorithmSuiteId())) { + throw new IllegalArgumentException( + "Missing value for required field `algorithmSuiteId`" + ); } - if (Objects.isNull(this.encryptedDataKeys())) { - throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`"); + if (Objects.isNull(this.encryptedDataKeys())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedDataKeys`" + ); } - if (Objects.isNull(this.storedEncryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `storedEncryptionContext`"); + if (Objects.isNull(this.storedEncryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `storedEncryptionContext`" + ); } return new ParsedHeader(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/AsSet.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/AsSet.java index 0c217c8b6..ac505632d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/AsSet.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/AsSet.java @@ -7,8 +7,8 @@ * Attribute must be a Set. Beacon value will also be a Set. */ public class AsSet { - protected AsSet(BuilderImpl builder) { - } + + protected AsSet(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -23,11 +23,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(AsSet model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(AsSet model) {} public AsSet build() { return new AsSet(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconKeySource.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconKeySource.java index 497eb096f..afd7273e0 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconKeySource.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconKeySource.java @@ -6,6 +6,7 @@ import java.util.Objects; public class BeaconKeySource { + /** * The configuration for using a single Beacon Key. */ @@ -68,12 +69,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected SingleKeyStore single; protected MultiKeyStore multi; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BeaconKeySource model) { this.single = model.single(); @@ -100,13 +101,15 @@ public MultiKeyStore multi() { public BeaconKeySource build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`BeaconKeySource` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`BeaconKeySource` is a Union. A Union MUST have one and only one value set." + ); } return new BeaconKeySource(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.single, this.multi}; + Object[] allValues = { this.single, this.multi }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconStyle.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconStyle.java index faf05ebea..29a79b070 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconStyle.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconStyle.java @@ -6,6 +6,7 @@ import java.util.Objects; public class BeaconStyle { + /** * Attribute must be used as part of a Compound Beacon, never alone. */ @@ -114,6 +115,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected PartOnly partOnly; protected Shared shared; @@ -122,8 +124,7 @@ static class BuilderImpl implements Builder { protected SharedSet sharedSet; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BeaconStyle model) { this.partOnly = model.partOnly(); @@ -170,13 +171,20 @@ public SharedSet sharedSet() { public BeaconStyle build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`BeaconStyle` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`BeaconStyle` is a Union. A Union MUST have one and only one value set." + ); } return new BeaconStyle(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.partOnly, this.shared, this.asSet, this.sharedSet}; + Object[] allValues = { + this.partOnly, + this.shared, + this.asSet, + this.sharedSet, + }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconVersion.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconVersion.java index 3bc307d61..d3cc346c4 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconVersion.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/BeaconVersion.java @@ -11,6 +11,7 @@ * The configuration for a particular version of searchable encryption. Currently the only supported version is '1'. */ public class BeaconVersion { + /** * The version of searchable encryption configured. This must be '1'. */ @@ -211,6 +212,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected int version; private boolean _versionSet = false; @@ -229,8 +231,7 @@ static class BuilderImpl implements Builder { protected List signedParts; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BeaconVersion model) { this.version = model.version(); @@ -319,34 +320,67 @@ public List signedParts() { public BeaconVersion build() { if (!this._versionSet) { - throw new IllegalArgumentException("Missing value for required field `version`"); + throw new IllegalArgumentException( + "Missing value for required field `version`" + ); } if (this._versionSet && this.version() < 1) { - throw new IllegalArgumentException("`version` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "`version` must be greater than or equal to 1" + ); } - if (Objects.isNull(this.keyStore())) { - throw new IllegalArgumentException("Missing value for required field `keyStore`"); + if (Objects.isNull(this.keyStore())) { + throw new IllegalArgumentException( + "Missing value for required field `keyStore`" + ); } - if (Objects.isNull(this.keySource())) { - throw new IllegalArgumentException("Missing value for required field `keySource`"); + if (Objects.isNull(this.keySource())) { + throw new IllegalArgumentException( + "Missing value for required field `keySource`" + ); } - if (Objects.isNull(this.standardBeacons())) { - throw new IllegalArgumentException("Missing value for required field `standardBeacons`"); + if (Objects.isNull(this.standardBeacons())) { + throw new IllegalArgumentException( + "Missing value for required field `standardBeacons`" + ); } - if (Objects.nonNull(this.standardBeacons()) && this.standardBeacons().size() < 1) { - throw new IllegalArgumentException("The size of `standardBeacons` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.standardBeacons()) && + this.standardBeacons().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `standardBeacons` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.compoundBeacons()) && this.compoundBeacons().size() < 1) { - throw new IllegalArgumentException("The size of `compoundBeacons` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.compoundBeacons()) && + this.compoundBeacons().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `compoundBeacons` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.virtualFields()) && this.virtualFields().size() < 1) { - throw new IllegalArgumentException("The size of `virtualFields` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.virtualFields()) && this.virtualFields().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `virtualFields` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.encryptedParts()) && this.encryptedParts().size() < 1) { - throw new IllegalArgumentException("The size of `encryptedParts` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.encryptedParts()) && + this.encryptedParts().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `encryptedParts` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.signedParts()) && this.signedParts().size() < 1) { - throw new IllegalArgumentException("The size of `signedParts` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.signedParts()) && this.signedParts().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `signedParts` must be greater than or equal to 1" + ); } return new BeaconVersion(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java index a6739ce8b..c6f441887 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java @@ -6,6 +6,7 @@ import java.util.List; public class CollectionOfErrors extends RuntimeException { + /** * The list of Exceptions encountered. */ @@ -90,14 +91,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected List list; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CollectionOfErrors model) { this.cause = model.getCause(); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CompoundBeacon.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CompoundBeacon.java index 92ab41ff1..79869d12d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CompoundBeacon.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CompoundBeacon.java @@ -10,6 +10,7 @@ * The configuration for a Compound Beacon. */ public class CompoundBeacon { + /** * The name of the Compound Beacon. */ @@ -141,6 +142,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected String split; @@ -151,8 +153,7 @@ static class BuilderImpl implements Builder { protected List constructors; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CompoundBeacon model) { this.name = model.name(); @@ -208,26 +209,42 @@ public List constructors() { } public CompoundBeacon build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } - if (Objects.isNull(this.split())) { - throw new IllegalArgumentException("Missing value for required field `split`"); + if (Objects.isNull(this.split())) { + throw new IllegalArgumentException( + "Missing value for required field `split`" + ); } if (Objects.nonNull(this.split()) && this.split().length() < 1) { - throw new IllegalArgumentException("The size of `split` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.split()) && this.split().length() > 1) { - throw new IllegalArgumentException("The size of `split` must be less than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be less than or equal to 1" + ); } if (Objects.nonNull(this.encrypted()) && this.encrypted().size() < 1) { - throw new IllegalArgumentException("The size of `encrypted` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `encrypted` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.signed()) && this.signed().size() < 1) { - throw new IllegalArgumentException("The size of `signed` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `signed` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.constructors()) && this.constructors().size() < 1) { - throw new IllegalArgumentException("The size of `constructors` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.constructors()) && this.constructors().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `constructors` must be greater than or equal to 1" + ); } return new CompoundBeacon(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Constructor.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Constructor.java index 8e7da3ece..cde63d686 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Constructor.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Constructor.java @@ -10,6 +10,7 @@ * The configuration for a particular Compound Beacon construction. */ public class Constructor { + /** * The ordered list of parts for a particular Compound Beacon construction. If the item contains all required Parts, a Compound beacon will be written using each Part that exists on the item, in the order specified. */ @@ -49,10 +50,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected List parts; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(Constructor model) { this.parts = model.parts(); @@ -68,11 +69,15 @@ public List parts() { } public Constructor build() { - if (Objects.isNull(this.parts())) { - throw new IllegalArgumentException("Missing value for required field `parts`"); + if (Objects.isNull(this.parts())) { + throw new IllegalArgumentException( + "Missing value for required field `parts`" + ); } if (Objects.nonNull(this.parts()) && this.parts().size() < 1) { - throw new IllegalArgumentException("The size of `parts` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `parts` must be greater than or equal to 1" + ); } return new Constructor(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/ConstructorPart.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/ConstructorPart.java index 295eabd26..a44a28a64 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/ConstructorPart.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/ConstructorPart.java @@ -9,6 +9,7 @@ * A part of a Compound Becaon Construction. */ public class ConstructorPart { + /** * The name of the Encrypted Part or Signed Part for which this constructor part gets a value. */ @@ -71,12 +72,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected Boolean required; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ConstructorPart model) { this.name = model.name(); @@ -102,11 +103,15 @@ public Boolean required() { } public ConstructorPart build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } - if (Objects.isNull(this.required())) { - throw new IllegalArgumentException("Missing value for required field `required`"); + if (Objects.isNull(this.required())) { + throw new IllegalArgumentException( + "Missing value for required field `required`" + ); } return new ConstructorPart(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierInput.java index 9f12c507f..b9981a00d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierInput.java @@ -11,12 +11,15 @@ * Inputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier */ public class CreateDynamoDbEncryptionBranchKeyIdSupplierInput { + /** * An implementation of the DynamoDbKeyBranchKeyIdSupplier interface, which determines what Branch Key to use for data key wrapping/unwrapping based on the DynamoDB item being written/read. */ private final IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier; - protected CreateDynamoDbEncryptionBranchKeyIdSupplierInput(BuilderImpl builder) { + protected CreateDynamoDbEncryptionBranchKeyIdSupplierInput( + BuilderImpl builder + ) { this.ddbKeyBranchKeyIdSupplier = builder.ddbKeyBranchKeyIdSupplier(); } @@ -39,7 +42,9 @@ public interface Builder { /** * @param ddbKeyBranchKeyIdSupplier An implementation of the DynamoDbKeyBranchKeyIdSupplier interface, which determines what Branch Key to use for data key wrapping/unwrapping based on the DynamoDB item being written/read. */ - Builder ddbKeyBranchKeyIdSupplier(IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier); + Builder ddbKeyBranchKeyIdSupplier( + IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier + ); /** * @return An implementation of the DynamoDbKeyBranchKeyIdSupplier interface, which determines what Branch Key to use for data key wrapping/unwrapping based on the DynamoDB item being written/read. @@ -50,18 +55,22 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier; - protected BuilderImpl() { - } + protected BuilderImpl() {} - protected BuilderImpl(CreateDynamoDbEncryptionBranchKeyIdSupplierInput model) { + protected BuilderImpl( + CreateDynamoDbEncryptionBranchKeyIdSupplierInput model + ) { this.ddbKeyBranchKeyIdSupplier = model.ddbKeyBranchKeyIdSupplier(); } public Builder ddbKeyBranchKeyIdSupplier( - IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier) { - this.ddbKeyBranchKeyIdSupplier = DynamoDbKeyBranchKeyIdSupplier.wrap(ddbKeyBranchKeyIdSupplier); + IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier + ) { + this.ddbKeyBranchKeyIdSupplier = + DynamoDbKeyBranchKeyIdSupplier.wrap(ddbKeyBranchKeyIdSupplier); return this; } @@ -70,8 +79,10 @@ public IDynamoDbKeyBranchKeyIdSupplier ddbKeyBranchKeyIdSupplier() { } public CreateDynamoDbEncryptionBranchKeyIdSupplierInput build() { - if (Objects.isNull(this.ddbKeyBranchKeyIdSupplier())) { - throw new IllegalArgumentException("Missing value for required field `ddbKeyBranchKeyIdSupplier`"); + if (Objects.isNull(this.ddbKeyBranchKeyIdSupplier())) { + throw new IllegalArgumentException( + "Missing value for required field `ddbKeyBranchKeyIdSupplier`" + ); } return new CreateDynamoDbEncryptionBranchKeyIdSupplierInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.java index 4dc39acff..eb6828167 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CreateDynamoDbEncryptionBranchKeyIdSupplierOutput.java @@ -11,12 +11,15 @@ * Outputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier */ public class CreateDynamoDbEncryptionBranchKeyIdSupplierOutput { + /** * The Branch Key Supplier for use with the Hierarchical Keyring. */ private final IBranchKeyIdSupplier branchKeyIdSupplier; - protected CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(BuilderImpl builder) { + protected CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( + BuilderImpl builder + ) { this.branchKeyIdSupplier = builder.branchKeyIdSupplier(); } @@ -50,16 +53,20 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected IBranchKeyIdSupplier branchKeyIdSupplier; - protected BuilderImpl() { - } + protected BuilderImpl() {} - protected BuilderImpl(CreateDynamoDbEncryptionBranchKeyIdSupplierOutput model) { + protected BuilderImpl( + CreateDynamoDbEncryptionBranchKeyIdSupplierOutput model + ) { this.branchKeyIdSupplier = model.branchKeyIdSupplier(); } - public Builder branchKeyIdSupplier(IBranchKeyIdSupplier branchKeyIdSupplier) { + public Builder branchKeyIdSupplier( + IBranchKeyIdSupplier branchKeyIdSupplier + ) { this.branchKeyIdSupplier = BranchKeyIdSupplier.wrap(branchKeyIdSupplier); return this; } @@ -69,8 +76,10 @@ public IBranchKeyIdSupplier branchKeyIdSupplier() { } public CreateDynamoDbEncryptionBranchKeyIdSupplierOutput build() { - if (Objects.isNull(this.branchKeyIdSupplier())) { - throw new IllegalArgumentException("Missing value for required field `branchKeyIdSupplier`"); + if (Objects.isNull(this.branchKeyIdSupplier())) { + throw new IllegalArgumentException( + "Missing value for required field `branchKeyIdSupplier`" + ); } return new CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionConfig.java index 7321e21a6..61a1bd45b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionConfig.java @@ -4,8 +4,8 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.model; public class DynamoDbEncryptionConfig { - protected DynamoDbEncryptionConfig(BuilderImpl builder) { - } + + protected DynamoDbEncryptionConfig(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -20,11 +20,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(DynamoDbEncryptionConfig model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(DynamoDbEncryptionConfig model) {} public DynamoDbEncryptionConfig build() { return new DynamoDbEncryptionConfig(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionException.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionException.java index 812de493c..b767efd5f 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionException.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbEncryptionException.java @@ -6,6 +6,7 @@ import java.util.Objects; public class DynamoDbEncryptionException extends RuntimeException { + protected DynamoDbEncryptionException(BuilderImpl builder) { super(messageFromBuilder(builder), builder.cause()); } @@ -67,12 +68,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbEncryptionException model) { this.message = model.message(); @@ -98,8 +99,10 @@ public Throwable cause() { } public DynamoDbEncryptionException build() { - if (Objects.isNull(this.message())) { - throw new IllegalArgumentException("Missing value for required field `message`"); + if (Objects.isNull(this.message())) { + throw new IllegalArgumentException( + "Missing value for required field `message`" + ); } return new DynamoDbEncryptionException(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTableEncryptionConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTableEncryptionConfig.java index 9baef7fc2..d1eb070f7 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTableEncryptionConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTableEncryptionConfig.java @@ -17,6 +17,7 @@ * The configuration for client-side encryption for a particular DynamoDB table. */ public class DynamoDbTableEncryptionConfig { + /** * The logical table name for this table. This is the name that is cryptographically bound with your data. This can be the same as the actual DynamoDB table name. It's purpose is to be distinct from the DynamoDB table name so that the data may still be authenticated if being read from different (but logically similar) tables, such as a backup table. */ @@ -84,7 +85,8 @@ protected DynamoDbTableEncryptionConfig(BuilderImpl builder) { this.search = builder.search(); this.attributeActionsOnEncrypt = builder.attributeActionsOnEncrypt(); this.allowedUnsignedAttributes = builder.allowedUnsignedAttributes(); - this.allowedUnsignedAttributePrefix = builder.allowedUnsignedAttributePrefix(); + this.allowedUnsignedAttributePrefix = + builder.allowedUnsignedAttributePrefix(); this.algorithmSuiteId = builder.algorithmSuiteId(); this.keyring = builder.keyring(); this.cmm = builder.cmm(); @@ -228,7 +230,9 @@ public interface Builder { /** * @param attributeActionsOnEncrypt A map that describes what attributes should be encrypted and/or signed on encrypt. This map must contain all attributes that might be encountered during encryption. */ - Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt); + Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ); /** * @return A map that describes what attributes should be encrypted and/or signed on encrypt. This map must contain all attributes that might be encountered during encryption. @@ -248,7 +252,9 @@ public interface Builder { /** * @param allowedUnsignedAttributePrefix A prefix such that, if during decryption any attribute has a name with this prefix, it is treated as unsigned. */ - Builder allowedUnsignedAttributePrefix(String allowedUnsignedAttributePrefix); + Builder allowedUnsignedAttributePrefix( + String allowedUnsignedAttributePrefix + ); /** * @return A prefix such that, if during decryption any attribute has a name with this prefix, it is treated as unsigned. @@ -309,6 +315,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String logicalTableName; protected String partitionKeyName; @@ -333,8 +340,7 @@ static class BuilderImpl implements Builder { protected PlaintextOverride plaintextOverride; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbTableEncryptionConfig model) { this.logicalTableName = model.logicalTableName(); @@ -343,7 +349,8 @@ protected BuilderImpl(DynamoDbTableEncryptionConfig model) { this.search = model.search(); this.attributeActionsOnEncrypt = model.attributeActionsOnEncrypt(); this.allowedUnsignedAttributes = model.allowedUnsignedAttributes(); - this.allowedUnsignedAttributePrefix = model.allowedUnsignedAttributePrefix(); + this.allowedUnsignedAttributePrefix = + model.allowedUnsignedAttributePrefix(); this.algorithmSuiteId = model.algorithmSuiteId(); this.keyring = model.keyring(); this.cmm = model.cmm(); @@ -387,7 +394,9 @@ public SearchConfig search() { return this.search; } - public Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt) { + public Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ) { this.attributeActionsOnEncrypt = attributeActionsOnEncrypt; return this; } @@ -396,7 +405,9 @@ public Map attributeActionsOnEncrypt() { return this.attributeActionsOnEncrypt; } - public Builder allowedUnsignedAttributes(List allowedUnsignedAttributes) { + public Builder allowedUnsignedAttributes( + List allowedUnsignedAttributes + ) { this.allowedUnsignedAttributes = allowedUnsignedAttributes; return this; } @@ -405,7 +416,9 @@ public List allowedUnsignedAttributes() { return this.allowedUnsignedAttributes; } - public Builder allowedUnsignedAttributePrefix(String allowedUnsignedAttributePrefix) { + public Builder allowedUnsignedAttributePrefix( + String allowedUnsignedAttributePrefix + ) { this.allowedUnsignedAttributePrefix = allowedUnsignedAttributePrefix; return this; } @@ -460,29 +473,58 @@ public PlaintextOverride plaintextOverride() { } public DynamoDbTableEncryptionConfig build() { - if (Objects.isNull(this.logicalTableName())) { - throw new IllegalArgumentException("Missing value for required field `logicalTableName`"); + if (Objects.isNull(this.logicalTableName())) { + throw new IllegalArgumentException( + "Missing value for required field `logicalTableName`" + ); } - if (Objects.isNull(this.partitionKeyName())) { - throw new IllegalArgumentException("Missing value for required field `partitionKeyName`"); + if (Objects.isNull(this.partitionKeyName())) { + throw new IllegalArgumentException( + "Missing value for required field `partitionKeyName`" + ); } - if (Objects.nonNull(this.partitionKeyName()) && this.partitionKeyName().length() < 1) { - throw new IllegalArgumentException("The size of `partitionKeyName` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.partitionKeyName()) && + this.partitionKeyName().length() < 1 + ) { + throw new IllegalArgumentException( + "The size of `partitionKeyName` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.partitionKeyName()) && this.partitionKeyName().length() > 255) { - throw new IllegalArgumentException("The size of `partitionKeyName` must be less than or equal to 255"); + if ( + Objects.nonNull(this.partitionKeyName()) && + this.partitionKeyName().length() > 255 + ) { + throw new IllegalArgumentException( + "The size of `partitionKeyName` must be less than or equal to 255" + ); } - if (Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() < 1) { - throw new IllegalArgumentException("The size of `sortKeyName` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() < 1 + ) { + throw new IllegalArgumentException( + "The size of `sortKeyName` must be greater than or equal to 1" + ); } - if (Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() > 255) { - throw new IllegalArgumentException("The size of `sortKeyName` must be less than or equal to 255"); + if ( + Objects.nonNull(this.sortKeyName()) && this.sortKeyName().length() > 255 + ) { + throw new IllegalArgumentException( + "The size of `sortKeyName` must be less than or equal to 255" + ); } - if (Objects.isNull(this.attributeActionsOnEncrypt())) { - throw new IllegalArgumentException("Missing value for required field `attributeActionsOnEncrypt`"); + if (Objects.isNull(this.attributeActionsOnEncrypt())) { + throw new IllegalArgumentException( + "Missing value for required field `attributeActionsOnEncrypt`" + ); } - if (Objects.nonNull(this.allowedUnsignedAttributes()) && this.allowedUnsignedAttributes().size() < 1) { - throw new IllegalArgumentException("The size of `allowedUnsignedAttributes` must be greater than or equal to 1"); + if ( + Objects.nonNull(this.allowedUnsignedAttributes()) && + this.allowedUnsignedAttributes().size() < 1 + ) { + throw new IllegalArgumentException( + "The size of `allowedUnsignedAttributes` must be greater than or equal to 1" + ); } return new DynamoDbTableEncryptionConfig(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTablesEncryptionConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTablesEncryptionConfig.java index 4a1f1c333..95d71c53a 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTablesEncryptionConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/DynamoDbTablesEncryptionConfig.java @@ -10,10 +10,14 @@ * The configuration for client-side encryption with multiple DynamoDB table. */ public class DynamoDbTablesEncryptionConfig { + /** * A map of DynamoDB table name to its configuration for client-side encryption. */ - private final Map tableEncryptionConfigs; + private final Map< + String, + DynamoDbTableEncryptionConfig + > tableEncryptionConfigs; protected DynamoDbTablesEncryptionConfig(BuilderImpl builder) { this.tableEncryptionConfigs = builder.tableEncryptionConfigs(); @@ -39,7 +43,8 @@ public interface Builder { * @param tableEncryptionConfigs A map of DynamoDB table name to its configuration for client-side encryption. */ Builder tableEncryptionConfigs( - Map tableEncryptionConfigs); + Map tableEncryptionConfigs + ); /** * @return A map of DynamoDB table name to its configuration for client-side encryption. @@ -50,17 +55,18 @@ Builder tableEncryptionConfigs( } static class BuilderImpl implements Builder { + protected Map tableEncryptionConfigs; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbTablesEncryptionConfig model) { this.tableEncryptionConfigs = model.tableEncryptionConfigs(); } public Builder tableEncryptionConfigs( - Map tableEncryptionConfigs) { + Map tableEncryptionConfigs + ) { this.tableEncryptionConfigs = tableEncryptionConfigs; return this; } @@ -70,8 +76,10 @@ public Map tableEncryptionConfigs() { } public DynamoDbTablesEncryptionConfig build() { - if (Objects.isNull(this.tableEncryptionConfigs())) { - throw new IllegalArgumentException("Missing value for required field `tableEncryptionConfigs`"); + if (Objects.isNull(this.tableEncryptionConfigs())) { + throw new IllegalArgumentException( + "Missing value for required field `tableEncryptionConfigs`" + ); } return new DynamoDbTablesEncryptionConfig(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/EncryptedPart.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/EncryptedPart.java index 934cd47fa..9437e980c 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/EncryptedPart.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/EncryptedPart.java @@ -9,6 +9,7 @@ * A part of a Compound Beacon that contains a beacon over encrypted data. */ public class EncryptedPart { + /** * The name of the Standard Beacon, whose value this Part will hold. */ @@ -71,12 +72,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected String prefix; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(EncryptedPart model) { this.name = model.name(); @@ -102,14 +103,20 @@ public String prefix() { } public EncryptedPart build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } - if (Objects.isNull(this.prefix())) { - throw new IllegalArgumentException("Missing value for required field `prefix`"); + if (Objects.isNull(this.prefix())) { + throw new IllegalArgumentException( + "Missing value for required field `prefix`" + ); } if (Objects.nonNull(this.prefix()) && this.prefix().length() < 1) { - throw new IllegalArgumentException("The size of `prefix` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `prefix` must be greater than or equal to 1" + ); } return new EncryptedPart(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyInput.java index db7c03974..260c42bcf 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyInput.java @@ -11,6 +11,7 @@ * Inputs for getting the Branch Key that should be used for wrapping and unwrapping data keys. */ public class GetBranchKeyIdFromDdbKeyInput { + /** * The partition and sort (if it exists) attributes on the item being read or written. */ @@ -50,10 +51,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map ddbKey; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetBranchKeyIdFromDdbKeyInput model) { this.ddbKey = model.ddbKey(); @@ -69,8 +70,10 @@ public Map ddbKey() { } public GetBranchKeyIdFromDdbKeyInput build() { - if (Objects.isNull(this.ddbKey())) { - throw new IllegalArgumentException("Missing value for required field `ddbKey`"); + if (Objects.isNull(this.ddbKey())) { + throw new IllegalArgumentException( + "Missing value for required field `ddbKey`" + ); } return new GetBranchKeyIdFromDdbKeyInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyOutput.java index e4ec8d1f1..44fc40090 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetBranchKeyIdFromDdbKeyOutput.java @@ -9,6 +9,7 @@ * Outputs for getting the Branch Key that should be used for wrapping and unwrapping data keys. */ public class GetBranchKeyIdFromDdbKeyOutput { + /** * The ID of the Branch Key that should be used to wrap and unwrap data keys for this item. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String branchKeyId; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetBranchKeyIdFromDdbKeyOutput model) { this.branchKeyId = model.branchKeyId(); @@ -67,8 +68,10 @@ public String branchKeyId() { } public GetBranchKeyIdFromDdbKeyOutput build() { - if (Objects.isNull(this.branchKeyId())) { - throw new IllegalArgumentException("Missing value for required field `branchKeyId`"); + if (Objects.isNull(this.branchKeyId())) { + throw new IllegalArgumentException( + "Missing value for required field `branchKeyId`" + ); } return new GetBranchKeyIdFromDdbKeyOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetPrefix.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetPrefix.java index 29c7bad04..3f340bac2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetPrefix.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetPrefix.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that gets the prefix of a string. */ public class GetPrefix { + /** * If positive, the number of characters to return from the front. If negative, the absolute number of characters to exclude from the end. e.g. GetPrefix(-1) returns all but the last character. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Integer length; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetPrefix model) { this.length = model.length(); @@ -67,8 +68,10 @@ public Integer length() { } public GetPrefix build() { - if (Objects.isNull(this.length())) { - throw new IllegalArgumentException("Missing value for required field `length`"); + if (Objects.isNull(this.length())) { + throw new IllegalArgumentException( + "Missing value for required field `length`" + ); } return new GetPrefix(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegment.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegment.java index ec5481bbe..42b9f61b8 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegment.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegment.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that splits a string and gets a particular segment of that split. */ public class GetSegment { + /** * The characters to split on. */ @@ -71,12 +72,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String split; protected Integer index; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetSegment model) { this.split = model.split(); @@ -102,17 +103,25 @@ public Integer index() { } public GetSegment build() { - if (Objects.isNull(this.split())) { - throw new IllegalArgumentException("Missing value for required field `split`"); + if (Objects.isNull(this.split())) { + throw new IllegalArgumentException( + "Missing value for required field `split`" + ); } if (Objects.nonNull(this.split()) && this.split().length() < 1) { - throw new IllegalArgumentException("The size of `split` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.split()) && this.split().length() > 1) { - throw new IllegalArgumentException("The size of `split` must be less than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be less than or equal to 1" + ); } - if (Objects.isNull(this.index())) { - throw new IllegalArgumentException("Missing value for required field `index`"); + if (Objects.isNull(this.index())) { + throw new IllegalArgumentException( + "Missing value for required field `index`" + ); } return new GetSegment(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegments.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegments.java index d1cbc0771..f367196df 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegments.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSegments.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that splits a string and gets a range of segments of that split. */ public class GetSegments { + /** * The characters to split on. */ @@ -94,14 +95,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String split; protected Integer low; protected Integer high; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetSegments model) { this.split = model.split(); @@ -137,20 +138,30 @@ public Integer high() { } public GetSegments build() { - if (Objects.isNull(this.split())) { - throw new IllegalArgumentException("Missing value for required field `split`"); + if (Objects.isNull(this.split())) { + throw new IllegalArgumentException( + "Missing value for required field `split`" + ); } if (Objects.nonNull(this.split()) && this.split().length() < 1) { - throw new IllegalArgumentException("The size of `split` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.split()) && this.split().length() > 1) { - throw new IllegalArgumentException("The size of `split` must be less than or equal to 1"); + throw new IllegalArgumentException( + "The size of `split` must be less than or equal to 1" + ); } - if (Objects.isNull(this.low())) { - throw new IllegalArgumentException("Missing value for required field `low`"); + if (Objects.isNull(this.low())) { + throw new IllegalArgumentException( + "Missing value for required field `low`" + ); } - if (Objects.isNull(this.high())) { - throw new IllegalArgumentException("Missing value for required field `high`"); + if (Objects.isNull(this.high())) { + throw new IllegalArgumentException( + "Missing value for required field `high`" + ); } return new GetSegments(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSubstring.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSubstring.java index 7db87057e..d08faba18 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSubstring.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSubstring.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that gets a substring from a string. */ public class GetSubstring { + /** * The index to start the substring from, inclusive. Negative numbers count from the end. -1 is the last character of a string. */ @@ -71,12 +72,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Integer low; protected Integer high; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetSubstring model) { this.low = model.low(); @@ -102,11 +103,15 @@ public Integer high() { } public GetSubstring build() { - if (Objects.isNull(this.low())) { - throw new IllegalArgumentException("Missing value for required field `low`"); + if (Objects.isNull(this.low())) { + throw new IllegalArgumentException( + "Missing value for required field `low`" + ); } - if (Objects.isNull(this.high())) { - throw new IllegalArgumentException("Missing value for required field `high`"); + if (Objects.isNull(this.high())) { + throw new IllegalArgumentException( + "Missing value for required field `high`" + ); } return new GetSubstring(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSuffix.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSuffix.java index fd421a413..294b083a9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSuffix.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/GetSuffix.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that gets the suffix of a string. */ public class GetSuffix { + /** * If positive, the number of characters to return from the end. If negative, the absolute number of characters to exclude from the front. e.g. GetSuffix(-1) returns all but the first character. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Integer length; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetSuffix model) { this.length = model.length(); @@ -67,8 +68,10 @@ public Integer length() { } public GetSuffix build() { - if (Objects.isNull(this.length())) { - throw new IllegalArgumentException("Missing value for required field `length`"); + if (Objects.isNull(this.length())) { + throw new IllegalArgumentException( + "Missing value for required field `length`" + ); } return new GetSuffix(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Insert.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Insert.java index 031648da5..6ad371e87 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Insert.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Insert.java @@ -9,6 +9,7 @@ * The Virtual Part Transformation that appends a literal string. */ public class Insert { + /** * The literal string to append. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String literal; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(Insert model) { this.literal = model.literal(); @@ -67,8 +68,10 @@ public String literal() { } public Insert build() { - if (Objects.isNull(this.literal())) { - throw new IllegalArgumentException("Missing value for required field `literal`"); + if (Objects.isNull(this.literal())) { + throw new IllegalArgumentException( + "Missing value for required field `literal`" + ); } return new Insert(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyOverride.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyOverride.java index 268864f59..d4e5b0f1d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyOverride.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyOverride.java @@ -13,6 +13,7 @@ * A configuration for overriding encryption and/or decryption to instead perform legacy encryption and decryption. */ public class LegacyOverride { + /** * A policy which configurates whether legacy behavior overrides encryption and/or decryption. */ @@ -100,7 +101,9 @@ public interface Builder { /** * @param attributeActionsOnEncrypt Overrides which attributes are encrypted and/or signed for any items read or written with legacy behavior. */ - Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt); + Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ); /** * @return Overrides which attributes are encrypted and/or signed for any items read or written with legacy behavior. @@ -121,6 +124,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected LegacyPolicy policy; protected ILegacyDynamoDbEncryptor encryptor; @@ -129,8 +133,7 @@ static class BuilderImpl implements Builder { protected CryptoAction defaultAttributeFlag; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(LegacyOverride model) { this.policy = model.policy(); @@ -157,7 +160,9 @@ public ILegacyDynamoDbEncryptor encryptor() { return this.encryptor; } - public Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt) { + public Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ) { this.attributeActionsOnEncrypt = attributeActionsOnEncrypt; return this; } @@ -176,14 +181,20 @@ public CryptoAction defaultAttributeFlag() { } public LegacyOverride build() { - if (Objects.isNull(this.policy())) { - throw new IllegalArgumentException("Missing value for required field `policy`"); + if (Objects.isNull(this.policy())) { + throw new IllegalArgumentException( + "Missing value for required field `policy`" + ); } - if (Objects.isNull(this.encryptor())) { - throw new IllegalArgumentException("Missing value for required field `encryptor`"); + if (Objects.isNull(this.encryptor())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptor`" + ); } - if (Objects.isNull(this.attributeActionsOnEncrypt())) { - throw new IllegalArgumentException("Missing value for required field `attributeActionsOnEncrypt`"); + if (Objects.isNull(this.attributeActionsOnEncrypt())) { + throw new IllegalArgumentException( + "Missing value for required field `attributeActionsOnEncrypt`" + ); } return new LegacyOverride(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyPolicy.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyPolicy.java index 6b56e2c5d..f611d70d8 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyPolicy.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/LegacyPolicy.java @@ -4,11 +4,17 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.model; public enum LegacyPolicy { - FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT("FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT"), + FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT( + "FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT" + ), - FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT("FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT"), + FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT( + "FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT" + ), - FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT("FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT"); + FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT( + "FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT" + ); private final String value; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Lower.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Lower.java index f7d1637c1..37014d70a 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Lower.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Lower.java @@ -7,8 +7,8 @@ * The Virtual Part Transformation that converts ASCII characters to lower case. */ public class Lower { - protected Lower(BuilderImpl builder) { - } + + protected Lower(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -23,11 +23,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(Lower model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(Lower model) {} public Lower build() { return new Lower(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/MultiKeyStore.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/MultiKeyStore.java index cbb58f3f8..0f1420eaa 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/MultiKeyStore.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/MultiKeyStore.java @@ -10,6 +10,7 @@ * The configuration for using multiple Beacon Keys. */ public class MultiKeyStore { + /** * The name of the field that stores the Beacon Key. This may be a Virtual Field. */ @@ -95,14 +96,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String keyFieldName; protected Integer cacheTTL; protected CacheType cache; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(MultiKeyStore model) { this.keyFieldName = model.keyFieldName(); @@ -138,11 +139,15 @@ public CacheType cache() { } public MultiKeyStore build() { - if (Objects.isNull(this.keyFieldName())) { - throw new IllegalArgumentException("Missing value for required field `keyFieldName`"); + if (Objects.isNull(this.keyFieldName())) { + throw new IllegalArgumentException( + "Missing value for required field `keyFieldName`" + ); } - if (Objects.isNull(this.cacheTTL())) { - throw new IllegalArgumentException("Missing value for required field `cacheTTL`"); + if (Objects.isNull(this.cacheTTL())) { + throw new IllegalArgumentException( + "Missing value for required field `cacheTTL`" + ); } return new MultiKeyStore(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/OpaqueError.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/OpaqueError.java index 377a322a5..4d14ddd42 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/OpaqueError.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/OpaqueError.java @@ -4,6 +4,7 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.model; public class OpaqueError extends RuntimeException { + /** * The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed. */ @@ -88,14 +89,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected Object obj; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(OpaqueError model) { this.cause = model.getCause(); @@ -131,7 +132,9 @@ public Object obj() { } public OpaqueError build() { - if (this.obj != null && this.cause == null && this.obj instanceof Throwable) { + if ( + this.obj != null && this.cause == null && this.obj instanceof Throwable + ) { this.cause = (Throwable) this.obj; } else if (this.obj == null && this.cause != null) { this.obj = this.cause; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PartOnly.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PartOnly.java index dfd41a508..2dcfa4e65 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PartOnly.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PartOnly.java @@ -7,8 +7,8 @@ * Attribute must be used as part of a Compound Beacon, never alone. */ public class PartOnly { - protected PartOnly(BuilderImpl builder) { - } + + protected PartOnly(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -23,11 +23,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(PartOnly model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(PartOnly model) {} public PartOnly build() { return new PartOnly(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PlaintextOverride.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PlaintextOverride.java index e440ef064..a5985a5e7 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PlaintextOverride.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/PlaintextOverride.java @@ -4,11 +4,17 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.model; public enum PlaintextOverride { - FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ("FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ"), + FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ( + "FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ" + ), - FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ("FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ"), + FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ( + "FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ" + ), - FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ("FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ"); + FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ( + "FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ" + ); private final String value; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SearchConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SearchConfig.java index 2f73db6f5..e0561ef49 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SearchConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SearchConfig.java @@ -10,6 +10,7 @@ * The configuration for searchable encryption. */ public class SearchConfig { + /** * The versions of searchable encryption to support reading. Currently must contain a single configuration with version '1'. */ @@ -72,14 +73,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected List versions; protected int writeVersion; private boolean _writeVersionSet = false; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(SearchConfig model) { this.versions = model.versions(); @@ -107,20 +108,30 @@ public int writeVersion() { } public SearchConfig build() { - if (Objects.isNull(this.versions())) { - throw new IllegalArgumentException("Missing value for required field `versions`"); + if (Objects.isNull(this.versions())) { + throw new IllegalArgumentException( + "Missing value for required field `versions`" + ); } if (Objects.nonNull(this.versions()) && this.versions().size() < 1) { - throw new IllegalArgumentException("The size of `versions` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `versions` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.versions()) && this.versions().size() > 1) { - throw new IllegalArgumentException("The size of `versions` must be less than or equal to 1"); + throw new IllegalArgumentException( + "The size of `versions` must be less than or equal to 1" + ); } if (!this._writeVersionSet) { - throw new IllegalArgumentException("Missing value for required field `writeVersion`"); + throw new IllegalArgumentException( + "Missing value for required field `writeVersion`" + ); } if (this._writeVersionSet && this.writeVersion() < 1) { - throw new IllegalArgumentException("`writeVersion` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "`writeVersion` must be greater than or equal to 1" + ); } return new SearchConfig(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Shared.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Shared.java index 4be82055a..427959039 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Shared.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Shared.java @@ -9,6 +9,7 @@ * This beacon should calculate values like another beacon, so they can be compared. */ public class Shared { + /** * Calculate beacon values as for this beacon. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String other; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(Shared model) { this.other = model.other(); @@ -67,8 +68,10 @@ public String other() { } public Shared build() { - if (Objects.isNull(this.other())) { - throw new IllegalArgumentException("Missing value for required field `other`"); + if (Objects.isNull(this.other())) { + throw new IllegalArgumentException( + "Missing value for required field `other`" + ); } return new Shared(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SharedSet.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SharedSet.java index 9b51d0c98..41d27514e 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SharedSet.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SharedSet.java @@ -9,6 +9,7 @@ * Both Shared and AsSet. */ public class SharedSet { + /** * Calculate beacon values as for this beacon. */ @@ -48,10 +49,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String other; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(SharedSet model) { this.other = model.other(); @@ -67,8 +68,10 @@ public String other() { } public SharedSet build() { - if (Objects.isNull(this.other())) { - throw new IllegalArgumentException("Missing value for required field `other`"); + if (Objects.isNull(this.other())) { + throw new IllegalArgumentException( + "Missing value for required field `other`" + ); } return new SharedSet(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SignedPart.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SignedPart.java index 2166a61f2..3d999ad6e 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SignedPart.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SignedPart.java @@ -9,6 +9,7 @@ * A part of a Compound Beacon that contains signed plaintext data. */ public class SignedPart { + /** * The name for this Signed Part. */ @@ -94,14 +95,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected String prefix; protected String loc; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(SignedPart model) { this.name = model.name(); @@ -137,17 +138,25 @@ public String loc() { } public SignedPart build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } - if (Objects.isNull(this.prefix())) { - throw new IllegalArgumentException("Missing value for required field `prefix`"); + if (Objects.isNull(this.prefix())) { + throw new IllegalArgumentException( + "Missing value for required field `prefix`" + ); } if (Objects.nonNull(this.prefix()) && this.prefix().length() < 1) { - throw new IllegalArgumentException("The size of `prefix` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `prefix` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.loc()) && this.loc().length() < 1) { - throw new IllegalArgumentException("The size of `loc` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `loc` must be greater than or equal to 1" + ); } return new SignedPart(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SingleKeyStore.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SingleKeyStore.java index b4b520805..9ece5763f 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SingleKeyStore.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/SingleKeyStore.java @@ -9,6 +9,7 @@ * The configuration for using a single Beacon Key. */ public class SingleKeyStore { + /** * The Beacon Key ID. */ @@ -71,12 +72,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String keyId; protected Integer cacheTTL; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(SingleKeyStore model) { this.keyId = model.keyId(); @@ -102,11 +103,15 @@ public Integer cacheTTL() { } public SingleKeyStore build() { - if (Objects.isNull(this.keyId())) { - throw new IllegalArgumentException("Missing value for required field `keyId`"); + if (Objects.isNull(this.keyId())) { + throw new IllegalArgumentException( + "Missing value for required field `keyId`" + ); } - if (Objects.isNull(this.cacheTTL())) { - throw new IllegalArgumentException("Missing value for required field `cacheTTL`"); + if (Objects.isNull(this.cacheTTL())) { + throw new IllegalArgumentException( + "Missing value for required field `cacheTTL`" + ); } return new SingleKeyStore(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/StandardBeacon.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/StandardBeacon.java index bcd24a6ca..88bcbc1ef 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/StandardBeacon.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/StandardBeacon.java @@ -9,6 +9,7 @@ * The configuration for a Standard Beacon. */ public class StandardBeacon { + /** * The name for this Standard Beacon. */ @@ -117,6 +118,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected int length; @@ -127,8 +129,7 @@ static class BuilderImpl implements Builder { protected BeaconStyle style; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(StandardBeacon model) { this.name = model.name(); @@ -176,20 +177,30 @@ public BeaconStyle style() { } public StandardBeacon build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } if (!this._lengthSet) { - throw new IllegalArgumentException("Missing value for required field `length`"); + throw new IllegalArgumentException( + "Missing value for required field `length`" + ); } if (this._lengthSet && this.length() < 1) { - throw new IllegalArgumentException("`length` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "`length` must be greater than or equal to 1" + ); } if (this._lengthSet && this.length() > 63) { - throw new IllegalArgumentException("`length` must be less than or equal to 63."); + throw new IllegalArgumentException( + "`length` must be less than or equal to 63." + ); } if (Objects.nonNull(this.loc()) && this.loc().length() < 1) { - throw new IllegalArgumentException("The size of `loc` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `loc` must be greater than or equal to 1" + ); } return new StandardBeacon(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Upper.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Upper.java index faed92ccb..8e39072c9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Upper.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/Upper.java @@ -7,8 +7,8 @@ * The Virtual Part Transformation that converts ASCII characters to upper case. */ public class Upper { - protected Upper(BuilderImpl builder) { - } + + protected Upper(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -23,11 +23,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(Upper model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(Upper model) {} public Upper build() { return new Upper(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualField.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualField.java index 55fbeaad5..e95319fc2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualField.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualField.java @@ -10,6 +10,7 @@ * The configuration for a Virtual Field. A Virtual Field is a field constructed from parts of other fields for use with beacons, but never itself stored on items. */ public class VirtualField { + /** * The name of the Virtual Field. */ @@ -72,12 +73,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String name; protected List parts; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(VirtualField model) { this.name = model.name(); @@ -103,14 +104,20 @@ public List parts() { } public VirtualField build() { - if (Objects.isNull(this.name())) { - throw new IllegalArgumentException("Missing value for required field `name`"); + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException( + "Missing value for required field `name`" + ); } - if (Objects.isNull(this.parts())) { - throw new IllegalArgumentException("Missing value for required field `parts`"); + if (Objects.isNull(this.parts())) { + throw new IllegalArgumentException( + "Missing value for required field `parts`" + ); } if (Objects.nonNull(this.parts()) && this.parts().size() < 1) { - throw new IllegalArgumentException("The size of `parts` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `parts` must be greater than or equal to 1" + ); } return new VirtualField(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualPart.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualPart.java index 0f92bc95d..1bace2d92 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualPart.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualPart.java @@ -10,6 +10,7 @@ * A Virtual Part is the configuration of a transformation on an existing field in an item. */ public class VirtualPart { + /** * The DynamoDB document path to the value for this part. */ @@ -72,12 +73,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String loc; protected List trans; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(VirtualPart model) { this.loc = model.loc(); @@ -103,14 +104,20 @@ public List trans() { } public VirtualPart build() { - if (Objects.isNull(this.loc())) { - throw new IllegalArgumentException("Missing value for required field `loc`"); + if (Objects.isNull(this.loc())) { + throw new IllegalArgumentException( + "Missing value for required field `loc`" + ); } if (Objects.nonNull(this.loc()) && this.loc().length() < 1) { - throw new IllegalArgumentException("The size of `loc` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `loc` must be greater than or equal to 1" + ); } if (Objects.nonNull(this.trans()) && this.trans().size() < 1) { - throw new IllegalArgumentException("The size of `trans` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "The size of `trans` must be greater than or equal to 1" + ); } return new VirtualPart(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualTransform.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualTransform.java index 84d29ea14..e38113e46 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualTransform.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/VirtualTransform.java @@ -6,6 +6,7 @@ import java.util.Objects; public class VirtualTransform { + /** * The Virtual Part Transformation that converts ASCII characters to upper case. */ @@ -206,6 +207,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Upper upper; protected Lower lower; @@ -222,8 +224,7 @@ static class BuilderImpl implements Builder { protected GetSegments segments; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(VirtualTransform model) { this.upper = model.upper(); @@ -310,13 +311,24 @@ public GetSegments segments() { public VirtualTransform build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`VirtualTransform` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`VirtualTransform` is a Union. A Union MUST have one and only one value set." + ); } return new VirtualTransform(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.upper, this.lower, this.insert, this.prefix, this.suffix, this.substring, this.segment, this.segments}; + Object[] allValues = { + this.upper, + this.lower, + this.insert, + this.prefix, + this.suffix, + this.substring, + this.segment, + this.segments, + }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java index 7140ad9c4..278d33b07 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java @@ -7,7 +7,6 @@ import java.lang.IllegalArgumentException; import java.util.Objects; import software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbTablesEncryptionConfig; -import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.DynamoDbEncryptionTransformsClient; import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.__default; import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error; import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.IDynamoDbEncryptionTransformsClient; @@ -67,12 +66,18 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformOutput; public class DynamoDbEncryptionTransforms { + private final IDynamoDbEncryptionTransformsClient _impl; protected DynamoDbEncryptionTransforms(BuilderImpl builder) { - DynamoDbTablesEncryptionConfig input = builder.DynamoDbTablesEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.DynamoDbTablesEncryptionConfig(input); - Result result = __default.DynamoDbEncryptionTransforms(dafnyValue); + DynamoDbTablesEncryptionConfig input = + builder.DynamoDbTablesEncryptionConfig(); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.DynamoDbTablesEncryptionConfig( + input + ); + Result result = + __default.DynamoDbEncryptionTransforms(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -88,29 +93,48 @@ public static Builder builder() { } public BatchExecuteStatementInputTransformOutput BatchExecuteStatementInputTransform( - BatchExecuteStatementInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue = ToDafny.BatchExecuteStatementInputTransformInput(input); - Result result = this._impl.BatchExecuteStatementInputTransform(dafnyValue); + BatchExecuteStatementInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue = + ToDafny.BatchExecuteStatementInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformOutput, + Error + > result = this._impl.BatchExecuteStatementInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.BatchExecuteStatementInputTransformOutput(result.dtor_value()); + return ToNative.BatchExecuteStatementInputTransformOutput( + result.dtor_value() + ); } public BatchExecuteStatementOutputTransformOutput BatchExecuteStatementOutputTransform( - BatchExecuteStatementOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue = ToDafny.BatchExecuteStatementOutputTransformInput(input); - Result result = this._impl.BatchExecuteStatementOutputTransform(dafnyValue); + BatchExecuteStatementOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue = + ToDafny.BatchExecuteStatementOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformOutput, + Error + > result = this._impl.BatchExecuteStatementOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.BatchExecuteStatementOutputTransformOutput(result.dtor_value()); + return ToNative.BatchExecuteStatementOutputTransformOutput( + result.dtor_value() + ); } public BatchGetItemInputTransformOutput BatchGetItemInputTransform( - BatchGetItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue = ToDafny.BatchGetItemInputTransformInput(input); - Result result = this._impl.BatchGetItemInputTransform(dafnyValue); + BatchGetItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue = + ToDafny.BatchGetItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformOutput, + Error + > result = this._impl.BatchGetItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -118,9 +142,14 @@ public BatchGetItemInputTransformOutput BatchGetItemInputTransform( } public BatchGetItemOutputTransformOutput BatchGetItemOutputTransform( - BatchGetItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue = ToDafny.BatchGetItemOutputTransformInput(input); - Result result = this._impl.BatchGetItemOutputTransform(dafnyValue); + BatchGetItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue = + ToDafny.BatchGetItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformOutput, + Error + > result = this._impl.BatchGetItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -128,9 +157,14 @@ public BatchGetItemOutputTransformOutput BatchGetItemOutputTransform( } public BatchWriteItemInputTransformOutput BatchWriteItemInputTransform( - BatchWriteItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue = ToDafny.BatchWriteItemInputTransformInput(input); - Result result = this._impl.BatchWriteItemInputTransform(dafnyValue); + BatchWriteItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue = + ToDafny.BatchWriteItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformOutput, + Error + > result = this._impl.BatchWriteItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -138,9 +172,14 @@ public BatchWriteItemInputTransformOutput BatchWriteItemInputTransform( } public BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransform( - BatchWriteItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue = ToDafny.BatchWriteItemOutputTransformInput(input); - Result result = this._impl.BatchWriteItemOutputTransform(dafnyValue); + BatchWriteItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue = + ToDafny.BatchWriteItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformOutput, + Error + > result = this._impl.BatchWriteItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -148,9 +187,14 @@ public BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransform( } public DeleteItemInputTransformOutput DeleteItemInputTransform( - DeleteItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue = ToDafny.DeleteItemInputTransformInput(input); - Result result = this._impl.DeleteItemInputTransform(dafnyValue); + DeleteItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue = + ToDafny.DeleteItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformOutput, + Error + > result = this._impl.DeleteItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -158,9 +202,14 @@ public DeleteItemInputTransformOutput DeleteItemInputTransform( } public DeleteItemOutputTransformOutput DeleteItemOutputTransform( - DeleteItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue = ToDafny.DeleteItemOutputTransformInput(input); - Result result = this._impl.DeleteItemOutputTransform(dafnyValue); + DeleteItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue = + ToDafny.DeleteItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformOutput, + Error + > result = this._impl.DeleteItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -168,9 +217,14 @@ public DeleteItemOutputTransformOutput DeleteItemOutputTransform( } public ExecuteStatementInputTransformOutput ExecuteStatementInputTransform( - ExecuteStatementInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue = ToDafny.ExecuteStatementInputTransformInput(input); - Result result = this._impl.ExecuteStatementInputTransform(dafnyValue); + ExecuteStatementInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue = + ToDafny.ExecuteStatementInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformOutput, + Error + > result = this._impl.ExecuteStatementInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -178,9 +232,14 @@ public ExecuteStatementInputTransformOutput ExecuteStatementInputTransform( } public ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransform( - ExecuteStatementOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue = ToDafny.ExecuteStatementOutputTransformInput(input); - Result result = this._impl.ExecuteStatementOutputTransform(dafnyValue); + ExecuteStatementOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue = + ToDafny.ExecuteStatementOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformOutput, + Error + > result = this._impl.ExecuteStatementOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -188,9 +247,14 @@ public ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransform( } public ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransform( - ExecuteTransactionInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue = ToDafny.ExecuteTransactionInputTransformInput(input); - Result result = this._impl.ExecuteTransactionInputTransform(dafnyValue); + ExecuteTransactionInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue = + ToDafny.ExecuteTransactionInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformOutput, + Error + > result = this._impl.ExecuteTransactionInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -198,63 +262,106 @@ public ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransform( } public ExecuteTransactionOutputTransformOutput ExecuteTransactionOutputTransform( - ExecuteTransactionOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue = ToDafny.ExecuteTransactionOutputTransformInput(input); - Result result = this._impl.ExecuteTransactionOutputTransform(dafnyValue); + ExecuteTransactionOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue = + ToDafny.ExecuteTransactionOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformOutput, + Error + > result = this._impl.ExecuteTransactionOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.ExecuteTransactionOutputTransformOutput(result.dtor_value()); + return ToNative.ExecuteTransactionOutputTransformOutput( + result.dtor_value() + ); } - public GetItemInputTransformOutput GetItemInputTransform(GetItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue = ToDafny.GetItemInputTransformInput(input); - Result result = this._impl.GetItemInputTransform(dafnyValue); + public GetItemInputTransformOutput GetItemInputTransform( + GetItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue = + ToDafny.GetItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformOutput, + Error + > result = this._impl.GetItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.GetItemInputTransformOutput(result.dtor_value()); } - public GetItemOutputTransformOutput GetItemOutputTransform(GetItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue = ToDafny.GetItemOutputTransformInput(input); - Result result = this._impl.GetItemOutputTransform(dafnyValue); + public GetItemOutputTransformOutput GetItemOutputTransform( + GetItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue = + ToDafny.GetItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformOutput, + Error + > result = this._impl.GetItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.GetItemOutputTransformOutput(result.dtor_value()); } - public PutItemInputTransformOutput PutItemInputTransform(PutItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue = ToDafny.PutItemInputTransformInput(input); - Result result = this._impl.PutItemInputTransform(dafnyValue); + public PutItemInputTransformOutput PutItemInputTransform( + PutItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue = + ToDafny.PutItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformOutput, + Error + > result = this._impl.PutItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.PutItemInputTransformOutput(result.dtor_value()); } - public PutItemOutputTransformOutput PutItemOutputTransform(PutItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue = ToDafny.PutItemOutputTransformInput(input); - Result result = this._impl.PutItemOutputTransform(dafnyValue); + public PutItemOutputTransformOutput PutItemOutputTransform( + PutItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue = + ToDafny.PutItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformOutput, + Error + > result = this._impl.PutItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.PutItemOutputTransformOutput(result.dtor_value()); } - public QueryInputTransformOutput QueryInputTransform(QueryInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue = ToDafny.QueryInputTransformInput(input); - Result result = this._impl.QueryInputTransform(dafnyValue); + public QueryInputTransformOutput QueryInputTransform( + QueryInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue = + ToDafny.QueryInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformOutput, + Error + > result = this._impl.QueryInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.QueryInputTransformOutput(result.dtor_value()); } - public QueryOutputTransformOutput QueryOutputTransform(QueryOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue = ToDafny.QueryOutputTransformInput(input); - Result result = this._impl.QueryOutputTransform(dafnyValue); + public QueryOutputTransformOutput QueryOutputTransform( + QueryOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue = + ToDafny.QueryOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformOutput, + Error + > result = this._impl.QueryOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -265,27 +372,45 @@ public QueryOutputTransformOutput QueryOutputTransform(QueryOutputTransformInput * Given an Item, show the intermediate values (e.g. compound beacons, virtual fields). * */ - public ResolveAttributesOutput ResolveAttributes(ResolveAttributesInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue = ToDafny.ResolveAttributesInput(input); - Result result = this._impl.ResolveAttributes(dafnyValue); + public ResolveAttributesOutput ResolveAttributes( + ResolveAttributesInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue = + ToDafny.ResolveAttributesInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesOutput, + Error + > result = this._impl.ResolveAttributes(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.ResolveAttributesOutput(result.dtor_value()); } - public ScanInputTransformOutput ScanInputTransform(ScanInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue = ToDafny.ScanInputTransformInput(input); - Result result = this._impl.ScanInputTransform(dafnyValue); + public ScanInputTransformOutput ScanInputTransform( + ScanInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue = + ToDafny.ScanInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformOutput, + Error + > result = this._impl.ScanInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.ScanInputTransformOutput(result.dtor_value()); } - public ScanOutputTransformOutput ScanOutputTransform(ScanOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue = ToDafny.ScanOutputTransformInput(input); - Result result = this._impl.ScanOutputTransform(dafnyValue); + public ScanOutputTransformOutput ScanOutputTransform( + ScanOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue = + ToDafny.ScanOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformOutput, + Error + > result = this._impl.ScanOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -293,9 +418,14 @@ public ScanOutputTransformOutput ScanOutputTransform(ScanOutputTransformInput in } public TransactGetItemsInputTransformOutput TransactGetItemsInputTransform( - TransactGetItemsInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue = ToDafny.TransactGetItemsInputTransformInput(input); - Result result = this._impl.TransactGetItemsInputTransform(dafnyValue); + TransactGetItemsInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue = + ToDafny.TransactGetItemsInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformOutput, + Error + > result = this._impl.TransactGetItemsInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -303,9 +433,14 @@ public TransactGetItemsInputTransformOutput TransactGetItemsInputTransform( } public TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransform( - TransactGetItemsOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue = ToDafny.TransactGetItemsOutputTransformInput(input); - Result result = this._impl.TransactGetItemsOutputTransform(dafnyValue); + TransactGetItemsOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue = + ToDafny.TransactGetItemsOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformOutput, + Error + > result = this._impl.TransactGetItemsOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -313,9 +448,14 @@ public TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransform( } public TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransform( - TransactWriteItemsInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue = ToDafny.TransactWriteItemsInputTransformInput(input); - Result result = this._impl.TransactWriteItemsInputTransform(dafnyValue); + TransactWriteItemsInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue = + ToDafny.TransactWriteItemsInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformOutput, + Error + > result = this._impl.TransactWriteItemsInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -323,19 +463,31 @@ public TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransform( } public TransactWriteItemsOutputTransformOutput TransactWriteItemsOutputTransform( - TransactWriteItemsOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue = ToDafny.TransactWriteItemsOutputTransformInput(input); - Result result = this._impl.TransactWriteItemsOutputTransform(dafnyValue); + TransactWriteItemsOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue = + ToDafny.TransactWriteItemsOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformOutput, + Error + > result = this._impl.TransactWriteItemsOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.TransactWriteItemsOutputTransformOutput(result.dtor_value()); + return ToNative.TransactWriteItemsOutputTransformOutput( + result.dtor_value() + ); } public UpdateItemInputTransformOutput UpdateItemInputTransform( - UpdateItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue = ToDafny.UpdateItemInputTransformInput(input); - Result result = this._impl.UpdateItemInputTransform(dafnyValue); + UpdateItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue = + ToDafny.UpdateItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformOutput, + Error + > result = this._impl.UpdateItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -343,9 +495,14 @@ public UpdateItemInputTransformOutput UpdateItemInputTransform( } public UpdateItemOutputTransformOutput UpdateItemOutputTransform( - UpdateItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue = ToDafny.UpdateItemOutputTransformInput(input); - Result result = this._impl.UpdateItemOutputTransform(dafnyValue); + UpdateItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue = + ToDafny.UpdateItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformOutput, + Error + > result = this._impl.UpdateItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -361,7 +518,8 @@ public interface Builder { * @param DynamoDbTablesEncryptionConfig The configuration for client-side encryption with multiple DynamoDB table. */ Builder DynamoDbTablesEncryptionConfig( - DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig); + DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig + ); /** * @return The configuration for client-side encryption with multiple DynamoDB table. @@ -372,13 +530,14 @@ Builder DynamoDbTablesEncryptionConfig( } static class BuilderImpl implements Builder { + protected DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder DynamoDbTablesEncryptionConfig( - DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig) { + DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig + ) { this.DynamoDbTablesEncryptionConfig = DynamoDbTablesEncryptionConfig; return this; } @@ -388,8 +547,10 @@ public DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig() { } public DynamoDbEncryptionTransforms build() { - if (Objects.isNull(this.DynamoDbTablesEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbTablesEncryptionConfig`"); + if (Objects.isNull(this.DynamoDbTablesEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbTablesEncryptionConfig`" + ); } return new DynamoDbEncryptionTransforms(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToDafny.java index d543aeb3d..a2b9dc32a 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToDafny.java @@ -101,6 +101,7 @@ import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof DynamoDbEncryptionTransformsException) { return ToDafny.Error((DynamoDbEncryptionTransformsException) nativeValue); @@ -119,442 +120,722 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static BatchExecuteStatementInputTransformInput BatchExecuteStatementInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementInputTransformInput nativeValue + ) { BatchExecuteStatementInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput( + nativeValue.sdkInput() + ); return new BatchExecuteStatementInputTransformInput(sdkInput); } public static BatchExecuteStatementInputTransformOutput BatchExecuteStatementInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementInputTransformOutput nativeValue + ) { BatchExecuteStatementInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput( + nativeValue.transformedInput() + ); return new BatchExecuteStatementInputTransformOutput(transformedInput); } public static BatchExecuteStatementOutputTransformInput BatchExecuteStatementOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementOutputTransformInput nativeValue + ) { BatchExecuteStatementOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementOutput( + nativeValue.sdkOutput() + ); BatchExecuteStatementInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput(nativeValue.originalInput()); - return new BatchExecuteStatementOutputTransformInput(sdkOutput, originalInput); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementInput( + nativeValue.originalInput() + ); + return new BatchExecuteStatementOutputTransformInput( + sdkOutput, + originalInput + ); } public static BatchExecuteStatementOutputTransformOutput BatchExecuteStatementOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchExecuteStatementOutputTransformOutput nativeValue + ) { BatchExecuteStatementOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchExecuteStatementOutput( + nativeValue.transformedOutput() + ); return new BatchExecuteStatementOutputTransformOutput(transformedOutput); } public static BatchGetItemInputTransformInput BatchGetItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemInputTransformInput nativeValue + ) { BatchGetItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput( + nativeValue.sdkInput() + ); return new BatchGetItemInputTransformInput(sdkInput); } public static BatchGetItemInputTransformOutput BatchGetItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemInputTransformOutput nativeValue + ) { BatchGetItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput( + nativeValue.transformedInput() + ); return new BatchGetItemInputTransformOutput(transformedInput); } public static BatchGetItemOutputTransformInput BatchGetItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemOutputTransformInput nativeValue + ) { BatchGetItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemOutput( + nativeValue.sdkOutput() + ); BatchGetItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemInput( + nativeValue.originalInput() + ); return new BatchGetItemOutputTransformInput(sdkOutput, originalInput); } public static BatchGetItemOutputTransformOutput BatchGetItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchGetItemOutputTransformOutput nativeValue + ) { BatchGetItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchGetItemOutput( + nativeValue.transformedOutput() + ); return new BatchGetItemOutputTransformOutput(transformedOutput); } public static BatchWriteItemInputTransformInput BatchWriteItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemInputTransformInput nativeValue + ) { BatchWriteItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput( + nativeValue.sdkInput() + ); return new BatchWriteItemInputTransformInput(sdkInput); } public static BatchWriteItemInputTransformOutput BatchWriteItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemInputTransformOutput nativeValue + ) { BatchWriteItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput( + nativeValue.transformedInput() + ); return new BatchWriteItemInputTransformOutput(transformedInput); } public static BatchWriteItemOutputTransformInput BatchWriteItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemOutputTransformInput nativeValue + ) { BatchWriteItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemOutput( + nativeValue.sdkOutput() + ); BatchWriteItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemInput( + nativeValue.originalInput() + ); return new BatchWriteItemOutputTransformInput(sdkOutput, originalInput); } public static BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.BatchWriteItemOutputTransformOutput nativeValue + ) { BatchWriteItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.BatchWriteItemOutput( + nativeValue.transformedOutput() + ); return new BatchWriteItemOutputTransformOutput(transformedOutput); } public static DeleteItemInputTransformInput DeleteItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemInputTransformInput nativeValue + ) { DeleteItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput( + nativeValue.sdkInput() + ); return new DeleteItemInputTransformInput(sdkInput); } public static DeleteItemInputTransformOutput DeleteItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemInputTransformOutput nativeValue + ) { DeleteItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput( + nativeValue.transformedInput() + ); return new DeleteItemInputTransformOutput(transformedInput); } public static DeleteItemOutputTransformInput DeleteItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemOutputTransformInput nativeValue + ) { DeleteItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemOutput( + nativeValue.sdkOutput() + ); DeleteItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemInput( + nativeValue.originalInput() + ); return new DeleteItemOutputTransformInput(sdkOutput, originalInput); } public static DeleteItemOutputTransformOutput DeleteItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.DeleteItemOutputTransformOutput nativeValue + ) { DeleteItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DeleteItemOutput( + nativeValue.transformedOutput() + ); return new DeleteItemOutputTransformOutput(transformedOutput); } public static ExecuteStatementInputTransformInput ExecuteStatementInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementInputTransformInput nativeValue + ) { ExecuteStatementInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput( + nativeValue.sdkInput() + ); return new ExecuteStatementInputTransformInput(sdkInput); } public static ExecuteStatementInputTransformOutput ExecuteStatementInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementInputTransformOutput nativeValue + ) { ExecuteStatementInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput( + nativeValue.transformedInput() + ); return new ExecuteStatementInputTransformOutput(transformedInput); } public static ExecuteStatementOutputTransformInput ExecuteStatementOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementOutputTransformInput nativeValue + ) { ExecuteStatementOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementOutput( + nativeValue.sdkOutput() + ); ExecuteStatementInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementInput( + nativeValue.originalInput() + ); return new ExecuteStatementOutputTransformInput(sdkOutput, originalInput); } public static ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteStatementOutputTransformOutput nativeValue + ) { ExecuteStatementOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteStatementOutput( + nativeValue.transformedOutput() + ); return new ExecuteStatementOutputTransformOutput(transformedOutput); } public static ExecuteTransactionInputTransformInput ExecuteTransactionInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionInputTransformInput nativeValue + ) { ExecuteTransactionInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput( + nativeValue.sdkInput() + ); return new ExecuteTransactionInputTransformInput(sdkInput); } public static ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionInputTransformOutput nativeValue + ) { ExecuteTransactionInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput( + nativeValue.transformedInput() + ); return new ExecuteTransactionInputTransformOutput(transformedInput); } public static ExecuteTransactionOutputTransformInput ExecuteTransactionOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionOutputTransformInput nativeValue + ) { ExecuteTransactionOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionOutput( + nativeValue.sdkOutput() + ); ExecuteTransactionInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionInput( + nativeValue.originalInput() + ); return new ExecuteTransactionOutputTransformInput(sdkOutput, originalInput); } public static ExecuteTransactionOutputTransformOutput ExecuteTransactionOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ExecuteTransactionOutputTransformOutput nativeValue + ) { ExecuteTransactionOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ExecuteTransactionOutput( + nativeValue.transformedOutput() + ); return new ExecuteTransactionOutputTransformOutput(transformedOutput); } public static GetItemInputTransformInput GetItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemInputTransformInput nativeValue + ) { GetItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput( + nativeValue.sdkInput() + ); return new GetItemInputTransformInput(sdkInput); } public static GetItemInputTransformOutput GetItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemInputTransformOutput nativeValue + ) { GetItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput( + nativeValue.transformedInput() + ); return new GetItemInputTransformOutput(transformedInput); } public static GetItemOutputTransformInput GetItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemOutputTransformInput nativeValue + ) { GetItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemOutput( + nativeValue.sdkOutput() + ); GetItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemInput( + nativeValue.originalInput() + ); return new GetItemOutputTransformInput(sdkOutput, originalInput); } public static GetItemOutputTransformOutput GetItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.GetItemOutputTransformOutput nativeValue + ) { GetItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.GetItemOutput( + nativeValue.transformedOutput() + ); return new GetItemOutputTransformOutput(transformedOutput); } public static PutItemInputTransformInput PutItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemInputTransformInput nativeValue + ) { PutItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput( + nativeValue.sdkInput() + ); return new PutItemInputTransformInput(sdkInput); } public static PutItemInputTransformOutput PutItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemInputTransformOutput nativeValue + ) { PutItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput( + nativeValue.transformedInput() + ); return new PutItemInputTransformOutput(transformedInput); } public static PutItemOutputTransformInput PutItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemOutputTransformInput nativeValue + ) { PutItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemOutput( + nativeValue.sdkOutput() + ); PutItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemInput( + nativeValue.originalInput() + ); return new PutItemOutputTransformInput(sdkOutput, originalInput); } public static PutItemOutputTransformOutput PutItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.PutItemOutputTransformOutput nativeValue + ) { PutItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.PutItemOutput( + nativeValue.transformedOutput() + ); return new PutItemOutputTransformOutput(transformedOutput); } public static QueryInputTransformInput QueryInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryInputTransformInput nativeValue + ) { QueryInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput( + nativeValue.sdkInput() + ); return new QueryInputTransformInput(sdkInput); } public static QueryInputTransformOutput QueryInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryInputTransformOutput nativeValue + ) { QueryInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput( + nativeValue.transformedInput() + ); return new QueryInputTransformOutput(transformedInput); } public static QueryOutputTransformInput QueryOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryOutputTransformInput nativeValue + ) { QueryOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryOutput( + nativeValue.sdkOutput() + ); QueryInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryInput( + nativeValue.originalInput() + ); return new QueryOutputTransformInput(sdkOutput, originalInput); } public static QueryOutputTransformOutput QueryOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.QueryOutputTransformOutput nativeValue + ) { QueryOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.QueryOutput( + nativeValue.transformedOutput() + ); return new QueryOutputTransformOutput(transformedOutput); } public static ResolveAttributesInput ResolveAttributesInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ResolveAttributesInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ResolveAttributesInput nativeValue + ) { DafnySequence tableName; - tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.TableName()); - DafnyMap, ? extends AttributeValue> item; - item = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.Item()); + tableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.TableName() + ); + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > item; + item = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.Item() + ); Option version; - version = Objects.nonNull(nativeValue.Version()) ? - Option.create_Some((nativeValue.Version())) + version = + Objects.nonNull(nativeValue.Version()) + ? Option.create_Some((nativeValue.Version())) : Option.create_None(); return new ResolveAttributesInput(tableName, item, version); } public static ResolveAttributesOutput ResolveAttributesOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ResolveAttributesOutput nativeValue) { - DafnyMap, ? extends DafnySequence> virtualFields; + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ResolveAttributesOutput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > virtualFields; virtualFields = ToDafny.StringMap(nativeValue.VirtualFields()); - DafnyMap, ? extends DafnySequence> compoundBeacons; + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > compoundBeacons; compoundBeacons = ToDafny.StringMap(nativeValue.CompoundBeacons()); return new ResolveAttributesOutput(virtualFields, compoundBeacons); } public static ScanInputTransformInput ScanInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanInputTransformInput nativeValue + ) { ScanInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput( + nativeValue.sdkInput() + ); return new ScanInputTransformInput(sdkInput); } public static ScanInputTransformOutput ScanInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanInputTransformOutput nativeValue + ) { ScanInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput( + nativeValue.transformedInput() + ); return new ScanInputTransformOutput(transformedInput); } public static ScanOutputTransformInput ScanOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanOutputTransformInput nativeValue + ) { ScanOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanOutput( + nativeValue.sdkOutput() + ); ScanInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanInput( + nativeValue.originalInput() + ); return new ScanOutputTransformInput(sdkOutput, originalInput); } public static ScanOutputTransformOutput ScanOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.ScanOutputTransformOutput nativeValue + ) { ScanOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.ScanOutput( + nativeValue.transformedOutput() + ); return new ScanOutputTransformOutput(transformedOutput); } public static TransactGetItemsInputTransformInput TransactGetItemsInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsInputTransformInput nativeValue + ) { TransactGetItemsInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput( + nativeValue.sdkInput() + ); return new TransactGetItemsInputTransformInput(sdkInput); } public static TransactGetItemsInputTransformOutput TransactGetItemsInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsInputTransformOutput nativeValue + ) { TransactGetItemsInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput( + nativeValue.transformedInput() + ); return new TransactGetItemsInputTransformOutput(transformedInput); } public static TransactGetItemsOutputTransformInput TransactGetItemsOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsOutputTransformInput nativeValue + ) { TransactGetItemsOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsOutput( + nativeValue.sdkOutput() + ); TransactGetItemsInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsInput( + nativeValue.originalInput() + ); return new TransactGetItemsOutputTransformInput(sdkOutput, originalInput); } public static TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactGetItemsOutputTransformOutput nativeValue + ) { TransactGetItemsOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactGetItemsOutput( + nativeValue.transformedOutput() + ); return new TransactGetItemsOutputTransformOutput(transformedOutput); } public static TransactWriteItemsInputTransformInput TransactWriteItemsInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsInputTransformInput nativeValue + ) { TransactWriteItemsInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput( + nativeValue.sdkInput() + ); return new TransactWriteItemsInputTransformInput(sdkInput); } public static TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsInputTransformOutput nativeValue + ) { TransactWriteItemsInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput( + nativeValue.transformedInput() + ); return new TransactWriteItemsInputTransformOutput(transformedInput); } public static TransactWriteItemsOutputTransformInput TransactWriteItemsOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsOutputTransformInput nativeValue + ) { TransactWriteItemsOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsOutput( + nativeValue.sdkOutput() + ); TransactWriteItemsInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsInput( + nativeValue.originalInput() + ); return new TransactWriteItemsOutputTransformInput(sdkOutput, originalInput); } public static TransactWriteItemsOutputTransformOutput TransactWriteItemsOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.TransactWriteItemsOutputTransformOutput nativeValue + ) { TransactWriteItemsOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.TransactWriteItemsOutput( + nativeValue.transformedOutput() + ); return new TransactWriteItemsOutputTransformOutput(transformedOutput); } public static UpdateItemInputTransformInput UpdateItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemInputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemInputTransformInput nativeValue + ) { UpdateItemInput sdkInput; - sdkInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput(nativeValue.sdkInput()); + sdkInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput( + nativeValue.sdkInput() + ); return new UpdateItemInputTransformInput(sdkInput); } public static UpdateItemInputTransformOutput UpdateItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemInputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemInputTransformOutput nativeValue + ) { UpdateItemInput transformedInput; - transformedInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput(nativeValue.transformedInput()); + transformedInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput( + nativeValue.transformedInput() + ); return new UpdateItemInputTransformOutput(transformedInput); } public static UpdateItemOutputTransformInput UpdateItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformInput nativeValue + ) { UpdateItemOutput sdkOutput; - sdkOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemOutput(nativeValue.sdkOutput()); + sdkOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemOutput( + nativeValue.sdkOutput() + ); UpdateItemInput originalInput; - originalInput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput(nativeValue.originalInput()); + originalInput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemInput( + nativeValue.originalInput() + ); return new UpdateItemOutputTransformInput(sdkOutput, originalInput); } public static UpdateItemOutputTransformOutput UpdateItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformOutput nativeValue + ) { UpdateItemOutput transformedOutput; - transformedOutput = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemOutput(nativeValue.transformedOutput()); + transformedOutput = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.UpdateItemOutput( + nativeValue.transformedOutput() + ); return new UpdateItemOutputTransformOutput(transformedOutput); } public static Error Error(DynamoDbEncryptionTransformsException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_DynamoDbEncryptionTransformsException(message); } - public static DafnyMap, ? extends DafnySequence> StringMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > StringMap(Map nativeValue) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence + ); } public static IDynamoDbEncryptionTransformsClient DynamoDbEncryptionTransforms( - DynamoDbEncryptionTransforms nativeValue) { + DynamoDbEncryptionTransforms nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToNative.java index e50bde40c..0d8cb2a2e 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/ToNative.java @@ -73,6 +73,7 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformOutput; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -82,23 +83,37 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static DynamoDbEncryptionTransformsException Error( - Error_DynamoDbEncryptionTransformsException dafnyValue) { - DynamoDbEncryptionTransformsException.Builder nativeBuilder = DynamoDbEncryptionTransformsException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + Error_DynamoDbEncryptionTransformsException dafnyValue + ) { + DynamoDbEncryptionTransformsException.Builder nativeBuilder = + DynamoDbEncryptionTransformsException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static RuntimeException Error(Error dafnyValue) { if (dafnyValue.is_DynamoDbEncryptionTransformsException()) { - return ToNative.Error((Error_DynamoDbEncryptionTransformsException) dafnyValue); + return ToNative.Error( + (Error_DynamoDbEncryptionTransformsException) dafnyValue + ); } if (dafnyValue.is_Opaque()) { return ToNative.Error((Error_Opaque) dafnyValue); @@ -107,16 +122,24 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_ComAmazonawsDynamodb()) { - return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsDynamodb()); + return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error( + dafnyValue.dtor_ComAmazonawsDynamodb() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkDynamoDb()) { - return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb()); + return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor()) { - return software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor()); + return software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkStructuredEncryption()) { - return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption()); + return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -124,271 +147,533 @@ public static RuntimeException Error(Error dafnyValue) { } public static BatchExecuteStatementInputTransformInput BatchExecuteStatementInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue) { - BatchExecuteStatementInputTransformInput.Builder nativeBuilder = BatchExecuteStatementInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue + ) { + BatchExecuteStatementInputTransformInput.Builder nativeBuilder = + BatchExecuteStatementInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static BatchExecuteStatementInputTransformOutput BatchExecuteStatementInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformOutput dafnyValue) { - BatchExecuteStatementInputTransformOutput.Builder nativeBuilder = BatchExecuteStatementInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformOutput dafnyValue + ) { + BatchExecuteStatementInputTransformOutput.Builder nativeBuilder = + BatchExecuteStatementInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static BatchExecuteStatementOutputTransformInput BatchExecuteStatementOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue) { - BatchExecuteStatementOutputTransformInput.Builder nativeBuilder = BatchExecuteStatementOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue + ) { + BatchExecuteStatementOutputTransformInput.Builder nativeBuilder = + BatchExecuteStatementOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static BatchExecuteStatementOutputTransformOutput BatchExecuteStatementOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformOutput dafnyValue) { - BatchExecuteStatementOutputTransformOutput.Builder nativeBuilder = BatchExecuteStatementOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformOutput dafnyValue + ) { + BatchExecuteStatementOutputTransformOutput.Builder nativeBuilder = + BatchExecuteStatementOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchExecuteStatementOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static BatchGetItemInputTransformInput BatchGetItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue) { - BatchGetItemInputTransformInput.Builder nativeBuilder = BatchGetItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue + ) { + BatchGetItemInputTransformInput.Builder nativeBuilder = + BatchGetItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static BatchGetItemInputTransformOutput BatchGetItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformOutput dafnyValue) { - BatchGetItemInputTransformOutput.Builder nativeBuilder = BatchGetItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformOutput dafnyValue + ) { + BatchGetItemInputTransformOutput.Builder nativeBuilder = + BatchGetItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static BatchGetItemOutputTransformInput BatchGetItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue) { - BatchGetItemOutputTransformInput.Builder nativeBuilder = BatchGetItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue + ) { + BatchGetItemOutputTransformInput.Builder nativeBuilder = + BatchGetItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static BatchGetItemOutputTransformOutput BatchGetItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformOutput dafnyValue) { - BatchGetItemOutputTransformOutput.Builder nativeBuilder = BatchGetItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformOutput dafnyValue + ) { + BatchGetItemOutputTransformOutput.Builder nativeBuilder = + BatchGetItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchGetItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static BatchWriteItemInputTransformInput BatchWriteItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue) { - BatchWriteItemInputTransformInput.Builder nativeBuilder = BatchWriteItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue + ) { + BatchWriteItemInputTransformInput.Builder nativeBuilder = + BatchWriteItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static BatchWriteItemInputTransformOutput BatchWriteItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformOutput dafnyValue) { - BatchWriteItemInputTransformOutput.Builder nativeBuilder = BatchWriteItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformOutput dafnyValue + ) { + BatchWriteItemInputTransformOutput.Builder nativeBuilder = + BatchWriteItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static BatchWriteItemOutputTransformInput BatchWriteItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue) { - BatchWriteItemOutputTransformInput.Builder nativeBuilder = BatchWriteItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue + ) { + BatchWriteItemOutputTransformInput.Builder nativeBuilder = + BatchWriteItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformOutput dafnyValue) { - BatchWriteItemOutputTransformOutput.Builder nativeBuilder = BatchWriteItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformOutput dafnyValue + ) { + BatchWriteItemOutputTransformOutput.Builder nativeBuilder = + BatchWriteItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.BatchWriteItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static DeleteItemInputTransformInput DeleteItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue) { - DeleteItemInputTransformInput.Builder nativeBuilder = DeleteItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue + ) { + DeleteItemInputTransformInput.Builder nativeBuilder = + DeleteItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static DeleteItemInputTransformOutput DeleteItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformOutput dafnyValue) { - DeleteItemInputTransformOutput.Builder nativeBuilder = DeleteItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformOutput dafnyValue + ) { + DeleteItemInputTransformOutput.Builder nativeBuilder = + DeleteItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static DeleteItemOutputTransformInput DeleteItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue) { - DeleteItemOutputTransformInput.Builder nativeBuilder = DeleteItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue + ) { + DeleteItemOutputTransformInput.Builder nativeBuilder = + DeleteItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static DeleteItemOutputTransformOutput DeleteItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformOutput dafnyValue) { - DeleteItemOutputTransformOutput.Builder nativeBuilder = DeleteItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformOutput dafnyValue + ) { + DeleteItemOutputTransformOutput.Builder nativeBuilder = + DeleteItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DeleteItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static ExecuteStatementInputTransformInput ExecuteStatementInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue) { - ExecuteStatementInputTransformInput.Builder nativeBuilder = ExecuteStatementInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue + ) { + ExecuteStatementInputTransformInput.Builder nativeBuilder = + ExecuteStatementInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static ExecuteStatementInputTransformOutput ExecuteStatementInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformOutput dafnyValue) { - ExecuteStatementInputTransformOutput.Builder nativeBuilder = ExecuteStatementInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformOutput dafnyValue + ) { + ExecuteStatementInputTransformOutput.Builder nativeBuilder = + ExecuteStatementInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static ExecuteStatementOutputTransformInput ExecuteStatementOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue) { - ExecuteStatementOutputTransformInput.Builder nativeBuilder = ExecuteStatementOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue + ) { + ExecuteStatementOutputTransformInput.Builder nativeBuilder = + ExecuteStatementOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformOutput dafnyValue) { - ExecuteStatementOutputTransformOutput.Builder nativeBuilder = ExecuteStatementOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformOutput dafnyValue + ) { + ExecuteStatementOutputTransformOutput.Builder nativeBuilder = + ExecuteStatementOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteStatementOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static ExecuteTransactionInputTransformInput ExecuteTransactionInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue) { - ExecuteTransactionInputTransformInput.Builder nativeBuilder = ExecuteTransactionInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue + ) { + ExecuteTransactionInputTransformInput.Builder nativeBuilder = + ExecuteTransactionInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformOutput dafnyValue) { - ExecuteTransactionInputTransformOutput.Builder nativeBuilder = ExecuteTransactionInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformOutput dafnyValue + ) { + ExecuteTransactionInputTransformOutput.Builder nativeBuilder = + ExecuteTransactionInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static ExecuteTransactionOutputTransformInput ExecuteTransactionOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue) { - ExecuteTransactionOutputTransformInput.Builder nativeBuilder = ExecuteTransactionOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue + ) { + ExecuteTransactionOutputTransformInput.Builder nativeBuilder = + ExecuteTransactionOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static ExecuteTransactionOutputTransformOutput ExecuteTransactionOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformOutput dafnyValue) { - ExecuteTransactionOutputTransformOutput.Builder nativeBuilder = ExecuteTransactionOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformOutput dafnyValue + ) { + ExecuteTransactionOutputTransformOutput.Builder nativeBuilder = + ExecuteTransactionOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ExecuteTransactionOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static GetItemInputTransformInput GetItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue) { - GetItemInputTransformInput.Builder nativeBuilder = GetItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue + ) { + GetItemInputTransformInput.Builder nativeBuilder = + GetItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static GetItemInputTransformOutput GetItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformOutput dafnyValue) { - GetItemInputTransformOutput.Builder nativeBuilder = GetItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformOutput dafnyValue + ) { + GetItemInputTransformOutput.Builder nativeBuilder = + GetItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static GetItemOutputTransformInput GetItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue) { - GetItemOutputTransformInput.Builder nativeBuilder = GetItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue + ) { + GetItemOutputTransformInput.Builder nativeBuilder = + GetItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static GetItemOutputTransformOutput GetItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformOutput dafnyValue) { - GetItemOutputTransformOutput.Builder nativeBuilder = GetItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformOutput dafnyValue + ) { + GetItemOutputTransformOutput.Builder nativeBuilder = + GetItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.GetItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static PutItemInputTransformInput PutItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue) { - PutItemInputTransformInput.Builder nativeBuilder = PutItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue + ) { + PutItemInputTransformInput.Builder nativeBuilder = + PutItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static PutItemInputTransformOutput PutItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformOutput dafnyValue) { - PutItemInputTransformOutput.Builder nativeBuilder = PutItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformOutput dafnyValue + ) { + PutItemInputTransformOutput.Builder nativeBuilder = + PutItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static PutItemOutputTransformInput PutItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue) { - PutItemOutputTransformInput.Builder nativeBuilder = PutItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue + ) { + PutItemOutputTransformInput.Builder nativeBuilder = + PutItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static PutItemOutputTransformOutput PutItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformOutput dafnyValue) { - PutItemOutputTransformOutput.Builder nativeBuilder = PutItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformOutput dafnyValue + ) { + PutItemOutputTransformOutput.Builder nativeBuilder = + PutItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.PutItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static QueryInputTransformInput QueryInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue) { - QueryInputTransformInput.Builder nativeBuilder = QueryInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue + ) { + QueryInputTransformInput.Builder nativeBuilder = + QueryInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static QueryInputTransformOutput QueryInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformOutput dafnyValue) { - QueryInputTransformOutput.Builder nativeBuilder = QueryInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformOutput dafnyValue + ) { + QueryInputTransformOutput.Builder nativeBuilder = + QueryInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static QueryOutputTransformInput QueryOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue) { - QueryOutputTransformInput.Builder nativeBuilder = QueryOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue + ) { + QueryOutputTransformInput.Builder nativeBuilder = + QueryOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static QueryOutputTransformOutput QueryOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformOutput dafnyValue) { - QueryOutputTransformOutput.Builder nativeBuilder = QueryOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformOutput dafnyValue + ) { + QueryOutputTransformOutput.Builder nativeBuilder = + QueryOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.QueryOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static ResolveAttributesInput ResolveAttributesInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue) { - ResolveAttributesInput.Builder nativeBuilder = ResolveAttributesInput.builder(); - nativeBuilder.TableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName())); - nativeBuilder.Item(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_Item())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue + ) { + ResolveAttributesInput.Builder nativeBuilder = + ResolveAttributesInput.builder(); + nativeBuilder.TableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_TableName() + ) + ); + nativeBuilder.Item( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_Item() + ) + ); if (dafnyValue.dtor_Version().is_Some()) { nativeBuilder.Version((dafnyValue.dtor_Version().dtor_value())); } @@ -396,139 +681,263 @@ public static ResolveAttributesInput ResolveAttributesInput( } public static ResolveAttributesOutput ResolveAttributesOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesOutput dafnyValue) { - ResolveAttributesOutput.Builder nativeBuilder = ResolveAttributesOutput.builder(); - nativeBuilder.VirtualFields(ToNative.StringMap(dafnyValue.dtor_VirtualFields())); - nativeBuilder.CompoundBeacons(ToNative.StringMap(dafnyValue.dtor_CompoundBeacons())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesOutput dafnyValue + ) { + ResolveAttributesOutput.Builder nativeBuilder = + ResolveAttributesOutput.builder(); + nativeBuilder.VirtualFields( + ToNative.StringMap(dafnyValue.dtor_VirtualFields()) + ); + nativeBuilder.CompoundBeacons( + ToNative.StringMap(dafnyValue.dtor_CompoundBeacons()) + ); return nativeBuilder.build(); } public static ScanInputTransformInput ScanInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue) { - ScanInputTransformInput.Builder nativeBuilder = ScanInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue + ) { + ScanInputTransformInput.Builder nativeBuilder = + ScanInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static ScanInputTransformOutput ScanInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformOutput dafnyValue) { - ScanInputTransformOutput.Builder nativeBuilder = ScanInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformOutput dafnyValue + ) { + ScanInputTransformOutput.Builder nativeBuilder = + ScanInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static ScanOutputTransformInput ScanOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue) { - ScanOutputTransformInput.Builder nativeBuilder = ScanOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue + ) { + ScanOutputTransformInput.Builder nativeBuilder = + ScanOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static ScanOutputTransformOutput ScanOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformOutput dafnyValue) { - ScanOutputTransformOutput.Builder nativeBuilder = ScanOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformOutput dafnyValue + ) { + ScanOutputTransformOutput.Builder nativeBuilder = + ScanOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.ScanOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static TransactGetItemsInputTransformInput TransactGetItemsInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue) { - TransactGetItemsInputTransformInput.Builder nativeBuilder = TransactGetItemsInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue + ) { + TransactGetItemsInputTransformInput.Builder nativeBuilder = + TransactGetItemsInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static TransactGetItemsInputTransformOutput TransactGetItemsInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformOutput dafnyValue) { - TransactGetItemsInputTransformOutput.Builder nativeBuilder = TransactGetItemsInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformOutput dafnyValue + ) { + TransactGetItemsInputTransformOutput.Builder nativeBuilder = + TransactGetItemsInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static TransactGetItemsOutputTransformInput TransactGetItemsOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue) { - TransactGetItemsOutputTransformInput.Builder nativeBuilder = TransactGetItemsOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue + ) { + TransactGetItemsOutputTransformInput.Builder nativeBuilder = + TransactGetItemsOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformOutput dafnyValue) { - TransactGetItemsOutputTransformOutput.Builder nativeBuilder = TransactGetItemsOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformOutput dafnyValue + ) { + TransactGetItemsOutputTransformOutput.Builder nativeBuilder = + TransactGetItemsOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactGetItemsOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static TransactWriteItemsInputTransformInput TransactWriteItemsInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue) { - TransactWriteItemsInputTransformInput.Builder nativeBuilder = TransactWriteItemsInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue + ) { + TransactWriteItemsInputTransformInput.Builder nativeBuilder = + TransactWriteItemsInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformOutput dafnyValue) { - TransactWriteItemsInputTransformOutput.Builder nativeBuilder = TransactWriteItemsInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformOutput dafnyValue + ) { + TransactWriteItemsInputTransformOutput.Builder nativeBuilder = + TransactWriteItemsInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static TransactWriteItemsOutputTransformInput TransactWriteItemsOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue) { - TransactWriteItemsOutputTransformInput.Builder nativeBuilder = TransactWriteItemsOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue + ) { + TransactWriteItemsOutputTransformInput.Builder nativeBuilder = + TransactWriteItemsOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static TransactWriteItemsOutputTransformOutput TransactWriteItemsOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformOutput dafnyValue) { - TransactWriteItemsOutputTransformOutput.Builder nativeBuilder = TransactWriteItemsOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformOutput dafnyValue + ) { + TransactWriteItemsOutputTransformOutput.Builder nativeBuilder = + TransactWriteItemsOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.TransactWriteItemsOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static UpdateItemInputTransformInput UpdateItemInputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue) { - UpdateItemInputTransformInput.Builder nativeBuilder = UpdateItemInputTransformInput.builder(); - nativeBuilder.sdkInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput(dafnyValue.dtor_sdkInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue + ) { + UpdateItemInputTransformInput.Builder nativeBuilder = + UpdateItemInputTransformInput.builder(); + nativeBuilder.sdkInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput( + dafnyValue.dtor_sdkInput() + ) + ); return nativeBuilder.build(); } public static UpdateItemInputTransformOutput UpdateItemInputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformOutput dafnyValue) { - UpdateItemInputTransformOutput.Builder nativeBuilder = UpdateItemInputTransformOutput.builder(); - nativeBuilder.transformedInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput(dafnyValue.dtor_transformedInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformOutput dafnyValue + ) { + UpdateItemInputTransformOutput.Builder nativeBuilder = + UpdateItemInputTransformOutput.builder(); + nativeBuilder.transformedInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput( + dafnyValue.dtor_transformedInput() + ) + ); return nativeBuilder.build(); } public static UpdateItemOutputTransformInput UpdateItemOutputTransformInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue) { - UpdateItemOutputTransformInput.Builder nativeBuilder = UpdateItemOutputTransformInput.builder(); - nativeBuilder.sdkOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemOutput(dafnyValue.dtor_sdkOutput())); - nativeBuilder.originalInput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput(dafnyValue.dtor_originalInput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue + ) { + UpdateItemOutputTransformInput.Builder nativeBuilder = + UpdateItemOutputTransformInput.builder(); + nativeBuilder.sdkOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemOutput( + dafnyValue.dtor_sdkOutput() + ) + ); + nativeBuilder.originalInput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemInput( + dafnyValue.dtor_originalInput() + ) + ); return nativeBuilder.build(); } public static UpdateItemOutputTransformOutput UpdateItemOutputTransformOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformOutput dafnyValue) { - UpdateItemOutputTransformOutput.Builder nativeBuilder = UpdateItemOutputTransformOutput.builder(); - nativeBuilder.transformedOutput(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemOutput(dafnyValue.dtor_transformedOutput())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformOutput dafnyValue + ) { + UpdateItemOutputTransformOutput.Builder nativeBuilder = + UpdateItemOutputTransformOutput.builder(); + nativeBuilder.transformedOutput( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.UpdateItemOutput( + dafnyValue.dtor_transformedOutput() + ) + ); return nativeBuilder.build(); } public static Map StringMap( - DafnyMap, ? extends DafnySequence> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String + ); } public static DynamoDbEncryptionTransforms DynamoDbEncryptionTransforms( - IDynamoDbEncryptionTransformsClient dafnyValue) { + IDynamoDbEncryptionTransformsClient dafnyValue + ) { return new DynamoDbEncryptionTransforms(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformInput.java index 64474b374..81a2a90f9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementRequest; public class BatchExecuteStatementInputTransformInput { + private final BatchExecuteStatementRequest sdkInput; protected BatchExecuteStatementInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchExecuteStatementRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchExecuteStatementInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public BatchExecuteStatementRequest sdkInput() { } public BatchExecuteStatementInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new BatchExecuteStatementInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformOutput.java index 4453a5f83..0a0fb3f25 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementRequest; public class BatchExecuteStatementInputTransformOutput { + private final BatchExecuteStatementRequest transformedInput; protected BatchExecuteStatementInputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchExecuteStatementRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchExecuteStatementInputTransformOutput model) { this.transformedInput = model.transformedInput(); } - public Builder transformedInput(BatchExecuteStatementRequest transformedInput) { + public Builder transformedInput( + BatchExecuteStatementRequest transformedInput + ) { this.transformedInput = transformedInput; return this; } @@ -53,8 +56,10 @@ public BatchExecuteStatementRequest transformedInput() { } public BatchExecuteStatementInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new BatchExecuteStatementInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformInput.java index 22077d4f8..2f89180cf 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementResponse; public class BatchExecuteStatementOutputTransformInput { + private final BatchExecuteStatementResponse sdkOutput; private final BatchExecuteStatementRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchExecuteStatementResponse sdkOutput; protected BatchExecuteStatementRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchExecuteStatementOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public BatchExecuteStatementRequest originalInput() { } public BatchExecuteStatementOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new BatchExecuteStatementOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformOutput.java index 9c5bbfabc..c2185f9eb 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchExecuteStatementOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementResponse; public class BatchExecuteStatementOutputTransformOutput { + private final BatchExecuteStatementResponse transformedOutput; protected BatchExecuteStatementOutputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchExecuteStatementResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchExecuteStatementOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); } - public Builder transformedOutput(BatchExecuteStatementResponse transformedOutput) { + public Builder transformedOutput( + BatchExecuteStatementResponse transformedOutput + ) { this.transformedOutput = transformedOutput; return this; } @@ -53,8 +56,10 @@ public BatchExecuteStatementResponse transformedOutput() { } public BatchExecuteStatementOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new BatchExecuteStatementOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformInput.java index 24b208120..360c70c49 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest; public class BatchGetItemInputTransformInput { + private final BatchGetItemRequest sdkInput; protected BatchGetItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchGetItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchGetItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public BatchGetItemRequest sdkInput() { } public BatchGetItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new BatchGetItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformOutput.java index c71e6ea65..ca9f10aa4 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest; public class BatchGetItemInputTransformOutput { + private final BatchGetItemRequest transformedInput; protected BatchGetItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchGetItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchGetItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public BatchGetItemRequest transformedInput() { } public BatchGetItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new BatchGetItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformInput.java index b45da93d3..5769cb985 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse; public class BatchGetItemOutputTransformInput { + private final BatchGetItemResponse sdkOutput; private final BatchGetItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchGetItemResponse sdkOutput; protected BatchGetItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchGetItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public BatchGetItemRequest originalInput() { } public BatchGetItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new BatchGetItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformOutput.java index 6e6e0e781..551a85a67 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchGetItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse; public class BatchGetItemOutputTransformOutput { + private final BatchGetItemResponse transformedOutput; protected BatchGetItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchGetItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchGetItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public BatchGetItemResponse transformedOutput() { } public BatchGetItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new BatchGetItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformInput.java index de51b879d..2b162ea90 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest; public class BatchWriteItemInputTransformInput { + private final BatchWriteItemRequest sdkInput; protected BatchWriteItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchWriteItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchWriteItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public BatchWriteItemRequest sdkInput() { } public BatchWriteItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new BatchWriteItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformOutput.java index a4fc9f66d..62014c5d1 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest; public class BatchWriteItemInputTransformOutput { + private final BatchWriteItemRequest transformedInput; protected BatchWriteItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchWriteItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchWriteItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public BatchWriteItemRequest transformedInput() { } public BatchWriteItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new BatchWriteItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformInput.java index b45a48c9d..711e59ed8 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse; public class BatchWriteItemOutputTransformInput { + private final BatchWriteItemResponse sdkOutput; private final BatchWriteItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchWriteItemResponse sdkOutput; protected BatchWriteItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchWriteItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public BatchWriteItemRequest originalInput() { } public BatchWriteItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new BatchWriteItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformOutput.java index e3a7916e5..cb6d0a66c 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/BatchWriteItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse; public class BatchWriteItemOutputTransformOutput { + private final BatchWriteItemResponse transformedOutput; protected BatchWriteItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected BatchWriteItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(BatchWriteItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public BatchWriteItemResponse transformedOutput() { } public BatchWriteItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new BatchWriteItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java index c7b54bec5..7a2ca9b05 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java @@ -6,6 +6,7 @@ import java.util.List; public class CollectionOfErrors extends RuntimeException { + /** * The list of Exceptions encountered. */ @@ -90,14 +91,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected List list; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CollectionOfErrors model) { this.cause = model.getCause(); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformInput.java index 707acb9bb..94f14a622 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest; public class DeleteItemInputTransformInput { + private final DeleteItemRequest sdkInput; protected DeleteItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DeleteItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DeleteItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public DeleteItemRequest sdkInput() { } public DeleteItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new DeleteItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformOutput.java index 3f7106590..f4295e34b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest; public class DeleteItemInputTransformOutput { + private final DeleteItemRequest transformedInput; protected DeleteItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DeleteItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DeleteItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public DeleteItemRequest transformedInput() { } public DeleteItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new DeleteItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformInput.java index 25208bd89..0147e9520 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse; public class DeleteItemOutputTransformInput { + private final DeleteItemResponse sdkOutput; private final DeleteItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DeleteItemResponse sdkOutput; protected DeleteItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DeleteItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public DeleteItemRequest originalInput() { } public DeleteItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new DeleteItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformOutput.java index 75cbb46e6..8c9f1d184 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DeleteItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse; public class DeleteItemOutputTransformOutput { + private final DeleteItemResponse transformedOutput; protected DeleteItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DeleteItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DeleteItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public DeleteItemResponse transformedOutput() { } public DeleteItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new DeleteItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DynamoDbEncryptionTransformsException.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DynamoDbEncryptionTransformsException.java index cd3ecbd41..0503f6bb1 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DynamoDbEncryptionTransformsException.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/DynamoDbEncryptionTransformsException.java @@ -6,6 +6,7 @@ import java.util.Objects; public class DynamoDbEncryptionTransformsException extends RuntimeException { + protected DynamoDbEncryptionTransformsException(BuilderImpl builder) { super(messageFromBuilder(builder), builder.cause()); } @@ -67,12 +68,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DynamoDbEncryptionTransformsException model) { this.message = model.message(); @@ -98,8 +99,10 @@ public Throwable cause() { } public DynamoDbEncryptionTransformsException build() { - if (Objects.isNull(this.message())) { - throw new IllegalArgumentException("Missing value for required field `message`"); + if (Objects.isNull(this.message())) { + throw new IllegalArgumentException( + "Missing value for required field `message`" + ); } return new DynamoDbEncryptionTransformsException(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformInput.java index 50bcc0251..4b814da5f 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementRequest; public class ExecuteStatementInputTransformInput { + private final ExecuteStatementRequest sdkInput; protected ExecuteStatementInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteStatementRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteStatementInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public ExecuteStatementRequest sdkInput() { } public ExecuteStatementInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new ExecuteStatementInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformOutput.java index e35ffb88c..e2908f8f7 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementRequest; public class ExecuteStatementInputTransformOutput { + private final ExecuteStatementRequest transformedInput; protected ExecuteStatementInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteStatementRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteStatementInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public ExecuteStatementRequest transformedInput() { } public ExecuteStatementInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new ExecuteStatementInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformInput.java index d39c95ad2..ce29d9740 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementResponse; public class ExecuteStatementOutputTransformInput { + private final ExecuteStatementResponse sdkOutput; private final ExecuteStatementRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteStatementResponse sdkOutput; protected ExecuteStatementRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteStatementOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public ExecuteStatementRequest originalInput() { } public ExecuteStatementOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new ExecuteStatementOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformOutput.java index ed5ce339a..069a8c6c9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteStatementOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementResponse; public class ExecuteStatementOutputTransformOutput { + private final ExecuteStatementResponse transformedOutput; protected ExecuteStatementOutputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteStatementResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteStatementOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); } - public Builder transformedOutput(ExecuteStatementResponse transformedOutput) { + public Builder transformedOutput( + ExecuteStatementResponse transformedOutput + ) { this.transformedOutput = transformedOutput; return this; } @@ -53,8 +56,10 @@ public ExecuteStatementResponse transformedOutput() { } public ExecuteStatementOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new ExecuteStatementOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformInput.java index 1b3b82b20..989861111 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionRequest; public class ExecuteTransactionInputTransformInput { + private final ExecuteTransactionRequest sdkInput; protected ExecuteTransactionInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteTransactionRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteTransactionInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public ExecuteTransactionRequest sdkInput() { } public ExecuteTransactionInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new ExecuteTransactionInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformOutput.java index 4719f8dfb..cbe5d906d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionRequest; public class ExecuteTransactionInputTransformOutput { + private final ExecuteTransactionRequest transformedInput; protected ExecuteTransactionInputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteTransactionRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteTransactionInputTransformOutput model) { this.transformedInput = model.transformedInput(); } - public Builder transformedInput(ExecuteTransactionRequest transformedInput) { + public Builder transformedInput( + ExecuteTransactionRequest transformedInput + ) { this.transformedInput = transformedInput; return this; } @@ -53,8 +56,10 @@ public ExecuteTransactionRequest transformedInput() { } public ExecuteTransactionInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new ExecuteTransactionInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformInput.java index b21ef19fd..9d24a982d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionResponse; public class ExecuteTransactionOutputTransformInput { + private final ExecuteTransactionResponse sdkOutput; private final ExecuteTransactionRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteTransactionResponse sdkOutput; protected ExecuteTransactionRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteTransactionOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public ExecuteTransactionRequest originalInput() { } public ExecuteTransactionOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new ExecuteTransactionOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformOutput.java index 56d0e2c1c..2fbc7e0e2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ExecuteTransactionOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionResponse; public class ExecuteTransactionOutputTransformOutput { + private final ExecuteTransactionResponse transformedOutput; protected ExecuteTransactionOutputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ExecuteTransactionResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ExecuteTransactionOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); } - public Builder transformedOutput(ExecuteTransactionResponse transformedOutput) { + public Builder transformedOutput( + ExecuteTransactionResponse transformedOutput + ) { this.transformedOutput = transformedOutput; return this; } @@ -53,8 +56,10 @@ public ExecuteTransactionResponse transformedOutput() { } public ExecuteTransactionOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new ExecuteTransactionOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformInput.java index 53f0f30bd..99808cc7d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.GetItemRequest; public class GetItemInputTransformInput { + private final GetItemRequest sdkInput; protected GetItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected GetItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public GetItemRequest sdkInput() { } public GetItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new GetItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformOutput.java index 2d00d235b..a94eb1600 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.GetItemRequest; public class GetItemInputTransformOutput { + private final GetItemRequest transformedInput; protected GetItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected GetItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public GetItemRequest transformedInput() { } public GetItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new GetItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformInput.java index a573f4ce7..764fe7cdc 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.GetItemResponse; public class GetItemOutputTransformInput { + private final GetItemResponse sdkOutput; private final GetItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected GetItemResponse sdkOutput; protected GetItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public GetItemRequest originalInput() { } public GetItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new GetItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformOutput.java index 3c40cfb33..8ebf42a5b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/GetItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.GetItemResponse; public class GetItemOutputTransformOutput { + private final GetItemResponse transformedOutput; protected GetItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected GetItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(GetItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public GetItemResponse transformedOutput() { } public GetItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new GetItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/OpaqueError.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/OpaqueError.java index 76776a8b3..86a831c90 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/OpaqueError.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/OpaqueError.java @@ -4,6 +4,7 @@ package software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model; public class OpaqueError extends RuntimeException { + /** * The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed. */ @@ -88,14 +89,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected Object obj; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(OpaqueError model) { this.cause = model.getCause(); @@ -131,7 +132,9 @@ public Object obj() { } public OpaqueError build() { - if (this.obj != null && this.cause == null && this.obj instanceof Throwable) { + if ( + this.obj != null && this.cause == null && this.obj instanceof Throwable + ) { this.cause = (Throwable) this.obj; } else if (this.obj == null && this.cause != null) { this.obj = this.cause; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformInput.java index 275f2c189..9bf02f0fe 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.PutItemRequest; public class PutItemInputTransformInput { + private final PutItemRequest sdkInput; protected PutItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected PutItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(PutItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public PutItemRequest sdkInput() { } public PutItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new PutItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformOutput.java index 2e72597be..cc06df561 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.PutItemRequest; public class PutItemInputTransformOutput { + private final PutItemRequest transformedInput; protected PutItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected PutItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(PutItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public PutItemRequest transformedInput() { } public PutItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new PutItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformInput.java index c16510de1..7e5afed34 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.PutItemResponse; public class PutItemOutputTransformInput { + private final PutItemResponse sdkOutput; private final PutItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected PutItemResponse sdkOutput; protected PutItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(PutItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public PutItemRequest originalInput() { } public PutItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new PutItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformOutput.java index ffb651b47..deec37efb 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/PutItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.PutItemResponse; public class PutItemOutputTransformOutput { + private final PutItemResponse transformedOutput; protected PutItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected PutItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(PutItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public PutItemResponse transformedOutput() { } public PutItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new PutItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformInput.java index a895af125..fe180f0d0 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.QueryRequest; public class QueryInputTransformInput { + private final QueryRequest sdkInput; protected QueryInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected QueryRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(QueryInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public QueryRequest sdkInput() { } public QueryInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new QueryInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformOutput.java index afcb66860..9d8b0c0b6 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.QueryRequest; public class QueryInputTransformOutput { + private final QueryRequest transformedInput; protected QueryInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected QueryRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(QueryInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public QueryRequest transformedInput() { } public QueryInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new QueryInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformInput.java index e0b9bbb86..c645ff4fa 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.QueryResponse; public class QueryOutputTransformInput { + private final QueryResponse sdkOutput; private final QueryRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected QueryResponse sdkOutput; protected QueryRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(QueryOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public QueryRequest originalInput() { } public QueryOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new QueryOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformOutput.java index 8ad5658b0..494b68583 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/QueryOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.QueryResponse; public class QueryOutputTransformOutput { + private final QueryResponse transformedOutput; protected QueryOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected QueryResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(QueryOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public QueryResponse transformedOutput() { } public QueryOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new QueryOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesInput.java index da8ecbedf..3b6eeec51 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.AttributeValue; public class ResolveAttributesInput { + /** * Use the config for this Table. */ @@ -93,6 +94,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String TableName; protected Map Item; @@ -101,8 +103,7 @@ static class BuilderImpl implements Builder { private boolean _VersionSet = false; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ResolveAttributesInput model) { this.TableName = model.TableName(); @@ -140,20 +141,32 @@ public int Version() { } public ResolveAttributesInput build() { - if (Objects.isNull(this.TableName())) { - throw new IllegalArgumentException("Missing value for required field `TableName`"); + if (Objects.isNull(this.TableName())) { + throw new IllegalArgumentException( + "Missing value for required field `TableName`" + ); } if (Objects.nonNull(this.TableName()) && this.TableName().length() < 3) { - throw new IllegalArgumentException("The size of `TableName` must be greater than or equal to 3"); + throw new IllegalArgumentException( + "The size of `TableName` must be greater than or equal to 3" + ); } - if (Objects.nonNull(this.TableName()) && this.TableName().length() > 255) { - throw new IllegalArgumentException("The size of `TableName` must be less than or equal to 255"); + if ( + Objects.nonNull(this.TableName()) && this.TableName().length() > 255 + ) { + throw new IllegalArgumentException( + "The size of `TableName` must be less than or equal to 255" + ); } - if (Objects.isNull(this.Item())) { - throw new IllegalArgumentException("Missing value for required field `Item`"); + if (Objects.isNull(this.Item())) { + throw new IllegalArgumentException( + "Missing value for required field `Item`" + ); } if (this._VersionSet && this.Version() < 1) { - throw new IllegalArgumentException("`Version` must be greater than or equal to 1"); + throw new IllegalArgumentException( + "`Version` must be greater than or equal to 1" + ); } return new ResolveAttributesInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesOutput.java index 478756a90..86f54dfb0 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ResolveAttributesOutput.java @@ -7,6 +7,7 @@ import java.util.Objects; public class ResolveAttributesOutput { + /** * Full plaintext of all calculable virtual fields. */ @@ -69,12 +70,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map VirtualFields; protected Map CompoundBeacons; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ResolveAttributesOutput model) { this.VirtualFields = model.VirtualFields(); @@ -100,11 +101,15 @@ public Map CompoundBeacons() { } public ResolveAttributesOutput build() { - if (Objects.isNull(this.VirtualFields())) { - throw new IllegalArgumentException("Missing value for required field `VirtualFields`"); + if (Objects.isNull(this.VirtualFields())) { + throw new IllegalArgumentException( + "Missing value for required field `VirtualFields`" + ); } - if (Objects.isNull(this.CompoundBeacons())) { - throw new IllegalArgumentException("Missing value for required field `CompoundBeacons`"); + if (Objects.isNull(this.CompoundBeacons())) { + throw new IllegalArgumentException( + "Missing value for required field `CompoundBeacons`" + ); } return new ResolveAttributesOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformInput.java index 6f2dfbfe6..1c6ce9ae1 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ScanRequest; public class ScanInputTransformInput { + private final ScanRequest sdkInput; protected ScanInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ScanRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ScanInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public ScanRequest sdkInput() { } public ScanInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new ScanInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformOutput.java index aa572fb2d..295b284a5 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ScanRequest; public class ScanInputTransformOutput { + private final ScanRequest transformedInput; protected ScanInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ScanRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ScanInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public ScanRequest transformedInput() { } public ScanInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new ScanInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformInput.java index 1083aaf3c..f2b693935 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.ScanResponse; public class ScanOutputTransformInput { + private final ScanResponse sdkOutput; private final ScanRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ScanResponse sdkOutput; protected ScanRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ScanOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public ScanRequest originalInput() { } public ScanOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new ScanOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformOutput.java index 701eccd28..bcf82a72d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/ScanOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.ScanResponse; public class ScanOutputTransformOutput { + private final ScanResponse transformedOutput; protected ScanOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ScanResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ScanOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public ScanResponse transformedOutput() { } public ScanOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new ScanOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformInput.java index 2013f1e1e..7b9fefee2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsRequest; public class TransactGetItemsInputTransformInput { + private final TransactGetItemsRequest sdkInput; protected TransactGetItemsInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactGetItemsRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactGetItemsInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public TransactGetItemsRequest sdkInput() { } public TransactGetItemsInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new TransactGetItemsInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformOutput.java index 1ff70bae6..c84dd95c4 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsRequest; public class TransactGetItemsInputTransformOutput { + private final TransactGetItemsRequest transformedInput; protected TransactGetItemsInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactGetItemsRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactGetItemsInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public TransactGetItemsRequest transformedInput() { } public TransactGetItemsInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new TransactGetItemsInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformInput.java index 45e520842..3c12c1fef 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsResponse; public class TransactGetItemsOutputTransformInput { + private final TransactGetItemsResponse sdkOutput; private final TransactGetItemsRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactGetItemsResponse sdkOutput; protected TransactGetItemsRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactGetItemsOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public TransactGetItemsRequest originalInput() { } public TransactGetItemsOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new TransactGetItemsOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformOutput.java index 378fffa53..af56561ee 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactGetItemsOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsResponse; public class TransactGetItemsOutputTransformOutput { + private final TransactGetItemsResponse transformedOutput; protected TransactGetItemsOutputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactGetItemsResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactGetItemsOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); } - public Builder transformedOutput(TransactGetItemsResponse transformedOutput) { + public Builder transformedOutput( + TransactGetItemsResponse transformedOutput + ) { this.transformedOutput = transformedOutput; return this; } @@ -53,8 +56,10 @@ public TransactGetItemsResponse transformedOutput() { } public TransactGetItemsOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new TransactGetItemsOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformInput.java index 3d6a5f424..87cb3fbe2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest; public class TransactWriteItemsInputTransformInput { + private final TransactWriteItemsRequest sdkInput; protected TransactWriteItemsInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactWriteItemsRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactWriteItemsInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public TransactWriteItemsRequest sdkInput() { } public TransactWriteItemsInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new TransactWriteItemsInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformOutput.java index 964f5a65f..b82753fcb 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest; public class TransactWriteItemsInputTransformOutput { + private final TransactWriteItemsRequest transformedInput; protected TransactWriteItemsInputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactWriteItemsRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactWriteItemsInputTransformOutput model) { this.transformedInput = model.transformedInput(); } - public Builder transformedInput(TransactWriteItemsRequest transformedInput) { + public Builder transformedInput( + TransactWriteItemsRequest transformedInput + ) { this.transformedInput = transformedInput; return this; } @@ -53,8 +56,10 @@ public TransactWriteItemsRequest transformedInput() { } public TransactWriteItemsInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new TransactWriteItemsInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformInput.java index ce401d6ea..83dcc77d2 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse; public class TransactWriteItemsOutputTransformInput { + private final TransactWriteItemsResponse sdkOutput; private final TransactWriteItemsRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactWriteItemsResponse sdkOutput; protected TransactWriteItemsRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactWriteItemsOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public TransactWriteItemsRequest originalInput() { } public TransactWriteItemsOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new TransactWriteItemsOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformOutput.java index 2880b3b1c..0ee1ba869 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/TransactWriteItemsOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse; public class TransactWriteItemsOutputTransformOutput { + private final TransactWriteItemsResponse transformedOutput; protected TransactWriteItemsOutputTransformOutput(BuilderImpl builder) { @@ -34,16 +35,18 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected TransactWriteItemsResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(TransactWriteItemsOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); } - public Builder transformedOutput(TransactWriteItemsResponse transformedOutput) { + public Builder transformedOutput( + TransactWriteItemsResponse transformedOutput + ) { this.transformedOutput = transformedOutput; return this; } @@ -53,8 +56,10 @@ public TransactWriteItemsResponse transformedOutput() { } public TransactWriteItemsOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new TransactWriteItemsOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformInput.java index f0965d1cf..8c9a6ffde 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformInput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest; public class UpdateItemInputTransformInput { + private final UpdateItemRequest sdkInput; protected UpdateItemInputTransformInput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected UpdateItemRequest sdkInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(UpdateItemInputTransformInput model) { this.sdkInput = model.sdkInput(); @@ -53,8 +54,10 @@ public UpdateItemRequest sdkInput() { } public UpdateItemInputTransformInput build() { - if (Objects.isNull(this.sdkInput())) { - throw new IllegalArgumentException("Missing value for required field `sdkInput`"); + if (Objects.isNull(this.sdkInput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkInput`" + ); } return new UpdateItemInputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformOutput.java index 1bccc530d..7b9635893 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemInputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest; public class UpdateItemInputTransformOutput { + private final UpdateItemRequest transformedInput; protected UpdateItemInputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected UpdateItemRequest transformedInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(UpdateItemInputTransformOutput model) { this.transformedInput = model.transformedInput(); @@ -53,8 +54,10 @@ public UpdateItemRequest transformedInput() { } public UpdateItemInputTransformOutput build() { - if (Objects.isNull(this.transformedInput())) { - throw new IllegalArgumentException("Missing value for required field `transformedInput`"); + if (Objects.isNull(this.transformedInput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedInput`" + ); } return new UpdateItemInputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformInput.java index 34dc72075..702b7c5fb 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformInput.java @@ -8,6 +8,7 @@ import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse; public class UpdateItemOutputTransformInput { + private final UpdateItemResponse sdkOutput; private final UpdateItemRequest originalInput; @@ -46,12 +47,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected UpdateItemResponse sdkOutput; protected UpdateItemRequest originalInput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(UpdateItemOutputTransformInput model) { this.sdkOutput = model.sdkOutput(); @@ -77,11 +78,15 @@ public UpdateItemRequest originalInput() { } public UpdateItemOutputTransformInput build() { - if (Objects.isNull(this.sdkOutput())) { - throw new IllegalArgumentException("Missing value for required field `sdkOutput`"); + if (Objects.isNull(this.sdkOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `sdkOutput`" + ); } - if (Objects.isNull(this.originalInput())) { - throw new IllegalArgumentException("Missing value for required field `originalInput`"); + if (Objects.isNull(this.originalInput())) { + throw new IllegalArgumentException( + "Missing value for required field `originalInput`" + ); } return new UpdateItemOutputTransformInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformOutput.java index fb61b0be4..e7a5f5c83 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/UpdateItemOutputTransformOutput.java @@ -7,6 +7,7 @@ import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse; public class UpdateItemOutputTransformOutput { + private final UpdateItemResponse transformedOutput; protected UpdateItemOutputTransformOutput(BuilderImpl builder) { @@ -34,10 +35,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected UpdateItemResponse transformedOutput; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(UpdateItemOutputTransformOutput model) { this.transformedOutput = model.transformedOutput(); @@ -53,8 +54,10 @@ public UpdateItemResponse transformedOutput() { } public UpdateItemOutputTransformOutput build() { - if (Objects.isNull(this.transformedOutput())) { - throw new IllegalArgumentException("Missing value for required field `transformedOutput`"); + if (Objects.isNull(this.transformedOutput())) { + throw new IllegalArgumentException( + "Missing value for required field `transformedOutput`" + ); } return new UpdateItemOutputTransformOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java index b181d887c..5e0d1a9d7 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java @@ -6,7 +6,6 @@ import Wrappers_Compile.Result; import java.lang.IllegalArgumentException; import java.util.Objects; -import software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.StructuredEncryptionClient; import software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.__default; import software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.Error; import software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.IStructuredEncryptionClient; @@ -17,12 +16,15 @@ import software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig; public class StructuredEncryption { + private final IStructuredEncryptionClient _impl; protected StructuredEncryption(BuilderImpl builder) { StructuredEncryptionConfig input = builder.StructuredEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue = ToDafny.StructuredEncryptionConfig(input); - Result result = __default.StructuredEncryption(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue = + ToDafny.StructuredEncryptionConfig(input); + Result result = + __default.StructuredEncryption(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -38,8 +40,12 @@ public static Builder builder() { } public DecryptStructureOutput DecryptStructure(DecryptStructureInput input) { - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue = ToDafny.DecryptStructureInput(input); - Result result = this._impl.DecryptStructure(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue = + ToDafny.DecryptStructureInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput, + Error + > result = this._impl.DecryptStructure(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -47,8 +53,12 @@ public DecryptStructureOutput DecryptStructure(DecryptStructureInput input) { } public EncryptStructureOutput EncryptStructure(EncryptStructureInput input) { - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue = ToDafny.EncryptStructureInput(input); - Result result = this._impl.EncryptStructure(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue = + ToDafny.EncryptStructureInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput, + Error + > result = this._impl.EncryptStructure(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -60,7 +70,9 @@ protected IStructuredEncryptionClient impl() { } public interface Builder { - Builder StructuredEncryptionConfig(StructuredEncryptionConfig StructuredEncryptionConfig); + Builder StructuredEncryptionConfig( + StructuredEncryptionConfig StructuredEncryptionConfig + ); StructuredEncryptionConfig StructuredEncryptionConfig(); @@ -68,13 +80,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredEncryptionConfig StructuredEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder StructuredEncryptionConfig( - StructuredEncryptionConfig StructuredEncryptionConfig) { + StructuredEncryptionConfig StructuredEncryptionConfig + ) { this.StructuredEncryptionConfig = StructuredEncryptionConfig; return this; } @@ -84,8 +97,10 @@ public StructuredEncryptionConfig StructuredEncryptionConfig() { } public StructuredEncryption build() { - if (Objects.isNull(this.StructuredEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `StructuredEncryptionConfig`"); + if (Objects.isNull(this.StructuredEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `StructuredEncryptionConfig`" + ); } return new StructuredEncryption(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java index 118f2ed73..289df81de 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java @@ -40,6 +40,7 @@ import software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof StructuredEncryptionException) { return ToDafny.Error((StructuredEncryptionException) nativeValue); @@ -58,284 +59,523 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static AuthenticateSchema AuthenticateSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema nativeValue + ) { AuthenticateSchemaContent content; content = ToDafny.AuthenticateSchemaContent(nativeValue.content()); - Option, ? extends AuthenticateAction>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.AuthenticateSchemaAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.AuthenticateSchemaAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new AuthenticateSchema(content, attributes); } public static CryptoSchema CryptoSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema nativeValue + ) { CryptoSchemaContent content; content = ToDafny.CryptoSchemaContent(nativeValue.content()); - Option, ? extends AuthenticateAction>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.CryptoSchemaAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.CryptoSchemaAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new CryptoSchema(content, attributes); } public static DecryptStructureInput DecryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureInput nativeValue + ) { DafnySequence tableName; - tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()); + tableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.tableName() + ); StructuredData encryptedStructure; - encryptedStructure = ToDafny.StructuredData(nativeValue.encryptedStructure()); + encryptedStructure = + ToDafny.StructuredData(nativeValue.encryptedStructure()); AuthenticateSchema authenticateSchema; - authenticateSchema = ToDafny.AuthenticateSchema(nativeValue.authenticateSchema()); + authenticateSchema = + ToDafny.AuthenticateSchema(nativeValue.authenticateSchema()); ICryptographicMaterialsManager cmm; - cmm = software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm()); - Option, ? extends DafnySequence>> encryptionContext; - encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext())) + cmm = + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ); + Option< + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > + > encryptionContext; + encryptionContext = + (Objects.nonNull(nativeValue.encryptionContext()) && + nativeValue.encryptionContext().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ) + ) : Option.create_None(); - return new DecryptStructureInput(tableName, encryptedStructure, authenticateSchema, cmm, encryptionContext); + return new DecryptStructureInput( + tableName, + encryptedStructure, + authenticateSchema, + cmm, + encryptionContext + ); } public static DecryptStructureOutput DecryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureOutput nativeValue + ) { StructuredData plaintextStructure; - plaintextStructure = ToDafny.StructuredData(nativeValue.plaintextStructure()); + plaintextStructure = + ToDafny.StructuredData(nativeValue.plaintextStructure()); ParsedHeader parsedHeader; parsedHeader = ToDafny.ParsedHeader(nativeValue.parsedHeader()); return new DecryptStructureOutput(plaintextStructure, parsedHeader); } public static EncryptStructureInput EncryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureInput nativeValue + ) { DafnySequence tableName; - tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()); + tableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.tableName() + ); StructuredData plaintextStructure; - plaintextStructure = ToDafny.StructuredData(nativeValue.plaintextStructure()); + plaintextStructure = + ToDafny.StructuredData(nativeValue.plaintextStructure()); CryptoSchema cryptoSchema; cryptoSchema = ToDafny.CryptoSchema(nativeValue.cryptoSchema()); ICryptographicMaterialsManager cmm; - cmm = software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm()); + cmm = + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ); Option algorithmSuiteId; - algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId())) + algorithmSuiteId = + Objects.nonNull(nativeValue.algorithmSuiteId()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ) + ) : Option.create_None(); - Option, ? extends DafnySequence>> encryptionContext; - encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > + > encryptionContext; + encryptionContext = + (Objects.nonNull(nativeValue.encryptionContext()) && + nativeValue.encryptionContext().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ) + ) : Option.create_None(); - return new EncryptStructureInput(tableName, plaintextStructure, cryptoSchema, cmm, algorithmSuiteId, encryptionContext); + return new EncryptStructureInput( + tableName, + plaintextStructure, + cryptoSchema, + cmm, + algorithmSuiteId, + encryptionContext + ); } public static EncryptStructureOutput EncryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureOutput nativeValue + ) { StructuredData encryptedStructure; - encryptedStructure = ToDafny.StructuredData(nativeValue.encryptedStructure()); + encryptedStructure = + ToDafny.StructuredData(nativeValue.encryptedStructure()); ParsedHeader parsedHeader; parsedHeader = ToDafny.ParsedHeader(nativeValue.parsedHeader()); return new EncryptStructureOutput(encryptedStructure, parsedHeader); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.ParsedHeader nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.ParsedHeader nativeValue + ) { CryptoSchema cryptoSchema; cryptoSchema = ToDafny.CryptoSchema(nativeValue.cryptoSchema()); DBEAlgorithmSuiteId algorithmSuiteId; - algorithmSuiteId = software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId()); + algorithmSuiteId = + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ); DafnySequence encryptedDataKeys; - encryptedDataKeys = software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys()); - DafnyMap, ? extends DafnySequence> storedEncryptionContext; - storedEncryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.storedEncryptionContext()); - return new ParsedHeader(cryptoSchema, algorithmSuiteId, encryptedDataKeys, storedEncryptionContext); + encryptedDataKeys = + software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList( + nativeValue.encryptedDataKeys() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > storedEncryptionContext; + storedEncryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.storedEncryptionContext() + ); + return new ParsedHeader( + cryptoSchema, + algorithmSuiteId, + encryptedDataKeys, + storedEncryptionContext + ); } public static StructuredData StructuredData( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData nativeValue + ) { StructuredDataContent content; content = ToDafny.StructuredDataContent(nativeValue.content()); - Option, ? extends StructuredDataTerminal>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.StructuredDataAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends StructuredDataTerminal + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.StructuredDataAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new StructuredData(content, attributes); } public static StructuredDataTerminal StructuredDataTerminal( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal nativeValue + ) { DafnySequence value; - value = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.value()); + value = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence( + nativeValue.value() + ); DafnySequence typeId; - typeId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.typeId()); + typeId = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence( + nativeValue.typeId() + ); return new StructuredDataTerminal(value, typeId); } public static StructuredEncryptionConfig StructuredEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig nativeValue + ) { return new StructuredEncryptionConfig(); } public static Error Error(StructuredEncryptionException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_StructuredEncryptionException(message); } public static AuthenticateAction AuthenticateAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction nativeValue + ) { switch (nativeValue) { - case SIGN: { - return AuthenticateAction.create_SIGN(); - } - case DO_NOT_SIGN: { - return AuthenticateAction.create_DO__NOT__SIGN(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction."); - } + case SIGN: + { + return AuthenticateAction.create_SIGN(); + } + case DO_NOT_SIGN: + { + return AuthenticateAction.create_DO__NOT__SIGN(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction." + ); + } } } public static CryptoAction CryptoAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction nativeValue + ) { switch (nativeValue) { - case ENCRYPT_AND_SIGN: { - return CryptoAction.create_ENCRYPT__AND__SIGN(); - } - case SIGN_ONLY: { - return CryptoAction.create_SIGN__ONLY(); - } - case DO_NOTHING: { - return CryptoAction.create_DO__NOTHING(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction."); - } + case ENCRYPT_AND_SIGN: + { + return CryptoAction.create_ENCRYPT__AND__SIGN(); + } + case SIGN_ONLY: + { + return CryptoAction.create_SIGN__ONLY(); + } + case DO_NOTHING: + { + return CryptoAction.create_DO__NOTHING(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction." + ); + } } } public static AuthenticateSchemaContent AuthenticateSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchemaContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchemaContent nativeValue + ) { if (Objects.nonNull(nativeValue.Action())) { - return AuthenticateSchemaContent.create_Action(ToDafny.AuthenticateAction(nativeValue.Action())); + return AuthenticateSchemaContent.create_Action( + ToDafny.AuthenticateAction(nativeValue.Action()) + ); } if (Objects.nonNull(nativeValue.SchemaMap())) { - return AuthenticateSchemaContent.create_SchemaMap(ToDafny.AuthenticateSchemaMap(nativeValue.SchemaMap())); + return AuthenticateSchemaContent.create_SchemaMap( + ToDafny.AuthenticateSchemaMap(nativeValue.SchemaMap()) + ); } if (Objects.nonNull(nativeValue.SchemaList())) { - return AuthenticateSchemaContent.create_SchemaList(ToDafny.AuthenticateSchemaList(nativeValue.SchemaList())); + return AuthenticateSchemaContent.create_SchemaList( + ToDafny.AuthenticateSchemaList(nativeValue.SchemaList()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent." + ); } public static CryptoSchemaContent CryptoSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchemaContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchemaContent nativeValue + ) { if (Objects.nonNull(nativeValue.Action())) { - return CryptoSchemaContent.create_Action(ToDafny.CryptoAction(nativeValue.Action())); + return CryptoSchemaContent.create_Action( + ToDafny.CryptoAction(nativeValue.Action()) + ); } if (Objects.nonNull(nativeValue.SchemaMap())) { - return CryptoSchemaContent.create_SchemaMap(ToDafny.CryptoSchemaMap(nativeValue.SchemaMap())); + return CryptoSchemaContent.create_SchemaMap( + ToDafny.CryptoSchemaMap(nativeValue.SchemaMap()) + ); } if (Objects.nonNull(nativeValue.SchemaList())) { - return CryptoSchemaContent.create_SchemaList(ToDafny.CryptoSchemaList(nativeValue.SchemaList())); + return CryptoSchemaContent.create_SchemaList( + ToDafny.CryptoSchemaList(nativeValue.SchemaList()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent." + ); } public static StructuredDataContent StructuredDataContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataContent nativeValue + ) { if (Objects.nonNull(nativeValue.Terminal())) { - return StructuredDataContent.create_Terminal(ToDafny.StructuredDataTerminal(nativeValue.Terminal())); + return StructuredDataContent.create_Terminal( + ToDafny.StructuredDataTerminal(nativeValue.Terminal()) + ); } if (Objects.nonNull(nativeValue.DataList())) { - return StructuredDataContent.create_DataList(ToDafny.StructuredDataList(nativeValue.DataList())); + return StructuredDataContent.create_DataList( + ToDafny.StructuredDataList(nativeValue.DataList()) + ); } if (Objects.nonNull(nativeValue.DataMap())) { - return StructuredDataContent.create_DataMap(ToDafny.StructuredDataMap(nativeValue.DataMap())); + return StructuredDataContent.create_DataMap( + ToDafny.StructuredDataMap(nativeValue.DataMap()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent." + ); } - public static DafnySequence AuthenticateSchemaList( - List nativeValue) { + public static DafnySequence< + ? extends AuthenticateSchema + > AuthenticateSchemaList( + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema, - AuthenticateSchema._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema, + AuthenticateSchema._typeDescriptor() + ); } public static DafnySequence CryptoSchemaList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema, - CryptoSchema._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema, + CryptoSchema._typeDescriptor() + ); } public static DafnySequence StructuredDataList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData, - StructuredData._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData, + StructuredData._typeDescriptor() + ); } - public static DafnyMap, ? extends AuthenticateAction> AuthenticateSchemaAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > AuthenticateSchemaAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction + ); } - public static DafnyMap, ? extends AuthenticateSchema> AuthenticateSchemaMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateSchema + > AuthenticateSchemaMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema + ); } - public static DafnyMap, ? extends AuthenticateAction> CryptoSchemaAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > CryptoSchemaAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction + ); } - public static DafnyMap, ? extends CryptoSchema> CryptoSchemaMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends CryptoSchema + > CryptoSchemaMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema + ); } - public static DafnyMap, ? extends StructuredDataTerminal> StructuredDataAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends StructuredDataTerminal + > StructuredDataAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredDataTerminal); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredDataTerminal + ); } - public static DafnyMap, ? extends StructuredData> StructuredDataMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends StructuredData + > StructuredDataMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData + ); } - public static IStructuredEncryptionClient StructuredEncryption(StructuredEncryption nativeValue) { + public static IStructuredEncryptionClient StructuredEncryption( + StructuredEncryption nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java index da1008704..b15fac15c 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java @@ -36,6 +36,7 @@ import software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionException; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -45,17 +46,29 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static StructuredEncryptionException Error( - Error_StructuredEncryptionException dafnyValue) { - StructuredEncryptionException.Builder nativeBuilder = StructuredEncryptionException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + Error_StructuredEncryptionException dafnyValue + ) { + StructuredEncryptionException.Builder nativeBuilder = + StructuredEncryptionException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } @@ -70,10 +83,14 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_AwsCryptographyPrimitives()) { - return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives()); + return software.amazon.cryptography.primitives.ToNative.Error( + dafnyValue.dtor_AwsCryptographyPrimitives() + ); } if (dafnyValue.is_AwsCryptographyMaterialProviders()) { - return software.amazon.cryptography.materialproviders.ToNative.Error(dafnyValue.dtor_AwsCryptographyMaterialProviders()); + return software.amazon.cryptography.materialproviders.ToNative.Error( + dafnyValue.dtor_AwsCryptographyMaterialProviders() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -81,117 +98,222 @@ public static RuntimeException Error(Error dafnyValue) { } public static AuthenticateSchema AuthenticateSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema dafnyValue + ) { AuthenticateSchema.Builder nativeBuilder = AuthenticateSchema.builder(); - nativeBuilder.content(ToNative.AuthenticateSchemaContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.AuthenticateSchemaContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.AuthenticateSchemaAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.AuthenticateSchemaAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static CryptoSchema CryptoSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema dafnyValue + ) { CryptoSchema.Builder nativeBuilder = CryptoSchema.builder(); - nativeBuilder.content(ToNative.CryptoSchemaContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.CryptoSchemaContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.CryptoSchemaAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.CryptoSchemaAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static DecryptStructureInput DecryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue) { - DecryptStructureInput.Builder nativeBuilder = DecryptStructureInput.builder(); - nativeBuilder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_tableName())); - nativeBuilder.encryptedStructure(ToNative.StructuredData(dafnyValue.dtor_encryptedStructure())); - nativeBuilder.authenticateSchema(ToNative.AuthenticateSchema(dafnyValue.dtor_authenticateSchema())); - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue + ) { + DecryptStructureInput.Builder nativeBuilder = + DecryptStructureInput.builder(); + nativeBuilder.tableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_tableName() + ) + ); + nativeBuilder.encryptedStructure( + ToNative.StructuredData(dafnyValue.dtor_encryptedStructure()) + ); + nativeBuilder.authenticateSchema( + ToNative.AuthenticateSchema(dafnyValue.dtor_authenticateSchema()) + ); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm() + ) + ); if (dafnyValue.dtor_encryptionContext().is_Some()) { - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext().dtor_value())); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext().dtor_value() + ) + ); } return nativeBuilder.build(); } public static DecryptStructureOutput DecryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput dafnyValue) { - DecryptStructureOutput.Builder nativeBuilder = DecryptStructureOutput.builder(); - nativeBuilder.plaintextStructure(ToNative.StructuredData(dafnyValue.dtor_plaintextStructure())); - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput dafnyValue + ) { + DecryptStructureOutput.Builder nativeBuilder = + DecryptStructureOutput.builder(); + nativeBuilder.plaintextStructure( + ToNative.StructuredData(dafnyValue.dtor_plaintextStructure()) + ); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader()) + ); return nativeBuilder.build(); } public static EncryptStructureInput EncryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue) { - EncryptStructureInput.Builder nativeBuilder = EncryptStructureInput.builder(); - nativeBuilder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_tableName())); - nativeBuilder.plaintextStructure(ToNative.StructuredData(dafnyValue.dtor_plaintextStructure())); - nativeBuilder.cryptoSchema(ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema())); - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue + ) { + EncryptStructureInput.Builder nativeBuilder = + EncryptStructureInput.builder(); + nativeBuilder.tableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_tableName() + ) + ); + nativeBuilder.plaintextStructure( + ToNative.StructuredData(dafnyValue.dtor_plaintextStructure()) + ); + nativeBuilder.cryptoSchema( + ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema()) + ); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm() + ) + ); if (dafnyValue.dtor_algorithmSuiteId().is_Some()) { - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value())); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId().dtor_value() + ) + ); } if (dafnyValue.dtor_encryptionContext().is_Some()) { - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext().dtor_value())); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext().dtor_value() + ) + ); } return nativeBuilder.build(); } public static EncryptStructureOutput EncryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput dafnyValue) { - EncryptStructureOutput.Builder nativeBuilder = EncryptStructureOutput.builder(); - nativeBuilder.encryptedStructure(ToNative.StructuredData(dafnyValue.dtor_encryptedStructure())); - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput dafnyValue + ) { + EncryptStructureOutput.Builder nativeBuilder = + EncryptStructureOutput.builder(); + nativeBuilder.encryptedStructure( + ToNative.StructuredData(dafnyValue.dtor_encryptedStructure()) + ); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader()) + ); return nativeBuilder.build(); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.ParsedHeader dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.ParsedHeader dafnyValue + ) { ParsedHeader.Builder nativeBuilder = ParsedHeader.builder(); - nativeBuilder.cryptoSchema(ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema())); - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId())); - nativeBuilder.encryptedDataKeys(software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys())); - nativeBuilder.storedEncryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_storedEncryptionContext())); + nativeBuilder.cryptoSchema( + ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema()) + ); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId() + ) + ); + nativeBuilder.encryptedDataKeys( + software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList( + dafnyValue.dtor_encryptedDataKeys() + ) + ); + nativeBuilder.storedEncryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_storedEncryptionContext() + ) + ); return nativeBuilder.build(); } public static StructuredData StructuredData( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData dafnyValue + ) { StructuredData.Builder nativeBuilder = StructuredData.builder(); - nativeBuilder.content(ToNative.StructuredDataContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.StructuredDataContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.StructuredDataAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.StructuredDataAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static StructuredDataTerminal StructuredDataTerminal( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal dafnyValue) { - StructuredDataTerminal.Builder nativeBuilder = StructuredDataTerminal.builder(); - nativeBuilder.value(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_value())); - nativeBuilder.typeId(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_typeId())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal dafnyValue + ) { + StructuredDataTerminal.Builder nativeBuilder = + StructuredDataTerminal.builder(); + nativeBuilder.value( + software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer( + dafnyValue.dtor_value() + ) + ); + nativeBuilder.typeId( + software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer( + dafnyValue.dtor_typeId() + ) + ); return nativeBuilder.build(); } public static StructuredEncryptionConfig StructuredEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue) { - StructuredEncryptionConfig.Builder nativeBuilder = StructuredEncryptionConfig.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue + ) { + StructuredEncryptionConfig.Builder nativeBuilder = + StructuredEncryptionConfig.builder(); return nativeBuilder.build(); } public static AuthenticateAction AuthenticateAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction dafnyValue + ) { if (dafnyValue.is_SIGN()) { return AuthenticateAction.SIGN; } if (dafnyValue.is_DO__NOT__SIGN()) { return AuthenticateAction.DO_NOT_SIGN; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction matches the input : " + + dafnyValue + ); } public static CryptoAction CryptoAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction dafnyValue + ) { if (dafnyValue.is_ENCRYPT__AND__SIGN()) { return CryptoAction.ENCRYPT_AND_SIGN; } @@ -201,124 +323,192 @@ public static CryptoAction CryptoAction( if (dafnyValue.is_DO__NOTHING()) { return CryptoAction.DO_NOTHING; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction matches the input : " + + dafnyValue + ); } public static AuthenticateSchemaContent AuthenticateSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent dafnyValue) { - AuthenticateSchemaContent.Builder nativeBuilder = AuthenticateSchemaContent.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent dafnyValue + ) { + AuthenticateSchemaContent.Builder nativeBuilder = + AuthenticateSchemaContent.builder(); if (dafnyValue.is_Action()) { - nativeBuilder.Action(ToNative.AuthenticateAction(dafnyValue.dtor_Action())); + nativeBuilder.Action( + ToNative.AuthenticateAction(dafnyValue.dtor_Action()) + ); } if (dafnyValue.is_SchemaMap()) { - nativeBuilder.SchemaMap(ToNative.AuthenticateSchemaMap(dafnyValue.dtor_SchemaMap())); + nativeBuilder.SchemaMap( + ToNative.AuthenticateSchemaMap(dafnyValue.dtor_SchemaMap()) + ); } if (dafnyValue.is_SchemaList()) { - nativeBuilder.SchemaList(ToNative.AuthenticateSchemaList(dafnyValue.dtor_SchemaList())); + nativeBuilder.SchemaList( + ToNative.AuthenticateSchemaList(dafnyValue.dtor_SchemaList()) + ); } return nativeBuilder.build(); } public static CryptoSchemaContent CryptoSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent dafnyValue + ) { CryptoSchemaContent.Builder nativeBuilder = CryptoSchemaContent.builder(); if (dafnyValue.is_Action()) { nativeBuilder.Action(ToNative.CryptoAction(dafnyValue.dtor_Action())); } if (dafnyValue.is_SchemaMap()) { - nativeBuilder.SchemaMap(ToNative.CryptoSchemaMap(dafnyValue.dtor_SchemaMap())); + nativeBuilder.SchemaMap( + ToNative.CryptoSchemaMap(dafnyValue.dtor_SchemaMap()) + ); } if (dafnyValue.is_SchemaList()) { - nativeBuilder.SchemaList(ToNative.CryptoSchemaList(dafnyValue.dtor_SchemaList())); + nativeBuilder.SchemaList( + ToNative.CryptoSchemaList(dafnyValue.dtor_SchemaList()) + ); } return nativeBuilder.build(); } public static StructuredDataContent StructuredDataContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent dafnyValue) { - StructuredDataContent.Builder nativeBuilder = StructuredDataContent.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent dafnyValue + ) { + StructuredDataContent.Builder nativeBuilder = + StructuredDataContent.builder(); if (dafnyValue.is_Terminal()) { - nativeBuilder.Terminal(ToNative.StructuredDataTerminal(dafnyValue.dtor_Terminal())); + nativeBuilder.Terminal( + ToNative.StructuredDataTerminal(dafnyValue.dtor_Terminal()) + ); } if (dafnyValue.is_DataList()) { - nativeBuilder.DataList(ToNative.StructuredDataList(dafnyValue.dtor_DataList())); + nativeBuilder.DataList( + ToNative.StructuredDataList(dafnyValue.dtor_DataList()) + ); } if (dafnyValue.is_DataMap()) { - nativeBuilder.DataMap(ToNative.StructuredDataMap(dafnyValue.dtor_DataMap())); + nativeBuilder.DataMap( + ToNative.StructuredDataMap(dafnyValue.dtor_DataMap()) + ); } return nativeBuilder.build(); } public static List AuthenticateSchemaList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema + ); } public static List CryptoSchemaList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema + ); } public static List StructuredDataList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData + ); } public static Map AuthenticateSchemaAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction + ); } public static Map AuthenticateSchemaMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema + ); } public static Map CryptoSchemaAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction + ); } public static Map CryptoSchemaMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema + ); } public static Map StructuredDataAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredDataTerminal); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredDataTerminal + ); } public static Map StructuredDataMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData + ); } - public static StructuredEncryption StructuredEncryption(IStructuredEncryptionClient dafnyValue) { + public static StructuredEncryption StructuredEncryption( + IStructuredEncryptionClient dafnyValue + ) { return new StructuredEncryption(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchema.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchema.java index 5e83921d3..e2086e579 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchema.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchema.java @@ -7,6 +7,7 @@ import java.util.Objects; public class AuthenticateSchema { + private final AuthenticateSchemaContent content; private final Map attributes; @@ -45,12 +46,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected AuthenticateSchemaContent content; protected Map attributes; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(AuthenticateSchema model) { this.content = model.content(); @@ -76,8 +77,10 @@ public Map attributes() { } public AuthenticateSchema build() { - if (Objects.isNull(this.content())) { - throw new IllegalArgumentException("Missing value for required field `content`"); + if (Objects.isNull(this.content())) { + throw new IllegalArgumentException( + "Missing value for required field `content`" + ); } return new AuthenticateSchema(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchemaContent.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchemaContent.java index 534a20ff6..dc4055c63 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchemaContent.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/AuthenticateSchemaContent.java @@ -8,6 +8,7 @@ import java.util.Objects; public class AuthenticateSchemaContent { + private final AuthenticateAction Action; private final Map SchemaMap; @@ -57,14 +58,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected AuthenticateAction Action; protected Map SchemaMap; protected List SchemaList; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(AuthenticateSchemaContent model) { this.Action = model.Action(); @@ -101,13 +102,15 @@ public List SchemaList() { public AuthenticateSchemaContent build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`AuthenticateSchemaContent` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`AuthenticateSchemaContent` is a Union. A Union MUST have one and only one value set." + ); } return new AuthenticateSchemaContent(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.Action, this.SchemaMap, this.SchemaList}; + Object[] allValues = { this.Action, this.SchemaMap, this.SchemaList }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java index ba62d5496..a4d45a553 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java @@ -6,6 +6,7 @@ import java.util.List; public class CollectionOfErrors extends RuntimeException { + /** * The list of Exceptions encountered. */ @@ -90,14 +91,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected List list; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CollectionOfErrors model) { this.cause = model.getCause(); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchema.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchema.java index 2e2d387bb..f65622ad4 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchema.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchema.java @@ -7,6 +7,7 @@ import java.util.Objects; public class CryptoSchema { + private final CryptoSchemaContent content; private final Map attributes; @@ -45,12 +46,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected CryptoSchemaContent content; protected Map attributes; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CryptoSchema model) { this.content = model.content(); @@ -76,8 +77,10 @@ public Map attributes() { } public CryptoSchema build() { - if (Objects.isNull(this.content())) { - throw new IllegalArgumentException("Missing value for required field `content`"); + if (Objects.isNull(this.content())) { + throw new IllegalArgumentException( + "Missing value for required field `content`" + ); } return new CryptoSchema(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchemaContent.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchemaContent.java index 501c2f79e..e3fad9730 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchemaContent.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoSchemaContent.java @@ -8,6 +8,7 @@ import java.util.Objects; public class CryptoSchemaContent { + private final CryptoAction Action; private final Map SchemaMap; @@ -57,14 +58,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected CryptoAction Action; protected Map SchemaMap; protected List SchemaList; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(CryptoSchemaContent model) { this.Action = model.Action(); @@ -101,13 +102,15 @@ public List SchemaList() { public CryptoSchemaContent build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`CryptoSchemaContent` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`CryptoSchemaContent` is a Union. A Union MUST have one and only one value set." + ); } return new CryptoSchemaContent(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.Action, this.SchemaMap, this.SchemaList}; + Object[] allValues = { this.Action, this.SchemaMap, this.SchemaList }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureInput.java index df819f39d..650de7727 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureInput.java @@ -9,6 +9,7 @@ import software.amazon.cryptography.materialproviders.ICryptographicMaterialsManager; public class DecryptStructureInput { + private final String tableName; private final StructuredData encryptedStructure; @@ -80,6 +81,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String tableName; protected StructuredData encryptedStructure; @@ -90,8 +92,7 @@ static class BuilderImpl implements Builder { protected Map encryptionContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DecryptStructureInput model) { this.tableName = model.tableName(); @@ -147,17 +148,25 @@ public Map encryptionContext() { } public DecryptStructureInput build() { - if (Objects.isNull(this.tableName())) { - throw new IllegalArgumentException("Missing value for required field `tableName`"); + if (Objects.isNull(this.tableName())) { + throw new IllegalArgumentException( + "Missing value for required field `tableName`" + ); } - if (Objects.isNull(this.encryptedStructure())) { - throw new IllegalArgumentException("Missing value for required field `encryptedStructure`"); + if (Objects.isNull(this.encryptedStructure())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedStructure`" + ); } - if (Objects.isNull(this.authenticateSchema())) { - throw new IllegalArgumentException("Missing value for required field `authenticateSchema`"); + if (Objects.isNull(this.authenticateSchema())) { + throw new IllegalArgumentException( + "Missing value for required field `authenticateSchema`" + ); } - if (Objects.isNull(this.cmm())) { - throw new IllegalArgumentException("Missing value for required field `cmm`"); + if (Objects.isNull(this.cmm())) { + throw new IllegalArgumentException( + "Missing value for required field `cmm`" + ); } return new DecryptStructureInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureOutput.java index 78ef4b72c..72348be44 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/DecryptStructureOutput.java @@ -6,6 +6,7 @@ import java.util.Objects; public class DecryptStructureOutput { + private final StructuredData plaintextStructure; private final ParsedHeader parsedHeader; @@ -44,12 +45,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredData plaintextStructure; protected ParsedHeader parsedHeader; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(DecryptStructureOutput model) { this.plaintextStructure = model.plaintextStructure(); @@ -75,11 +76,15 @@ public ParsedHeader parsedHeader() { } public DecryptStructureOutput build() { - if (Objects.isNull(this.plaintextStructure())) { - throw new IllegalArgumentException("Missing value for required field `plaintextStructure`"); + if (Objects.isNull(this.plaintextStructure())) { + throw new IllegalArgumentException( + "Missing value for required field `plaintextStructure`" + ); } - if (Objects.isNull(this.parsedHeader())) { - throw new IllegalArgumentException("Missing value for required field `parsedHeader`"); + if (Objects.isNull(this.parsedHeader())) { + throw new IllegalArgumentException( + "Missing value for required field `parsedHeader`" + ); } return new DecryptStructureOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureInput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureInput.java index c03a4df73..b6e0f5e4d 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureInput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureInput.java @@ -10,6 +10,7 @@ import software.amazon.cryptography.materialproviders.model.DBEAlgorithmSuiteId; public class EncryptStructureInput { + private final String tableName; private final StructuredData plaintextStructure; @@ -92,6 +93,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String tableName; protected StructuredData plaintextStructure; @@ -104,8 +106,7 @@ static class BuilderImpl implements Builder { protected Map encryptionContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(EncryptStructureInput model) { this.tableName = model.tableName(); @@ -171,17 +172,25 @@ public Map encryptionContext() { } public EncryptStructureInput build() { - if (Objects.isNull(this.tableName())) { - throw new IllegalArgumentException("Missing value for required field `tableName`"); + if (Objects.isNull(this.tableName())) { + throw new IllegalArgumentException( + "Missing value for required field `tableName`" + ); } - if (Objects.isNull(this.plaintextStructure())) { - throw new IllegalArgumentException("Missing value for required field `plaintextStructure`"); + if (Objects.isNull(this.plaintextStructure())) { + throw new IllegalArgumentException( + "Missing value for required field `plaintextStructure`" + ); } - if (Objects.isNull(this.cryptoSchema())) { - throw new IllegalArgumentException("Missing value for required field `cryptoSchema`"); + if (Objects.isNull(this.cryptoSchema())) { + throw new IllegalArgumentException( + "Missing value for required field `cryptoSchema`" + ); } - if (Objects.isNull(this.cmm())) { - throw new IllegalArgumentException("Missing value for required field `cmm`"); + if (Objects.isNull(this.cmm())) { + throw new IllegalArgumentException( + "Missing value for required field `cmm`" + ); } return new EncryptStructureInput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureOutput.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureOutput.java index 31ecdb0a9..f4573d7e6 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureOutput.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/EncryptStructureOutput.java @@ -6,6 +6,7 @@ import java.util.Objects; public class EncryptStructureOutput { + private final StructuredData encryptedStructure; private final ParsedHeader parsedHeader; @@ -44,12 +45,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredData encryptedStructure; protected ParsedHeader parsedHeader; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(EncryptStructureOutput model) { this.encryptedStructure = model.encryptedStructure(); @@ -75,11 +76,15 @@ public ParsedHeader parsedHeader() { } public EncryptStructureOutput build() { - if (Objects.isNull(this.encryptedStructure())) { - throw new IllegalArgumentException("Missing value for required field `encryptedStructure`"); + if (Objects.isNull(this.encryptedStructure())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedStructure`" + ); } - if (Objects.isNull(this.parsedHeader())) { - throw new IllegalArgumentException("Missing value for required field `parsedHeader`"); + if (Objects.isNull(this.parsedHeader())) { + throw new IllegalArgumentException( + "Missing value for required field `parsedHeader`" + ); } return new EncryptStructureOutput(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/OpaqueError.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/OpaqueError.java index ba0553977..0e8c7b28f 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/OpaqueError.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/OpaqueError.java @@ -4,6 +4,7 @@ package software.amazon.cryptography.dbencryptionsdk.structuredencryption.model; public class OpaqueError extends RuntimeException { + /** * The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed. */ @@ -88,14 +89,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; protected Object obj; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(OpaqueError model) { this.cause = model.getCause(); @@ -131,7 +132,9 @@ public Object obj() { } public OpaqueError build() { - if (this.obj != null && this.cause == null && this.obj instanceof Throwable) { + if ( + this.obj != null && this.cause == null && this.obj instanceof Throwable + ) { this.cause = (Throwable) this.obj; } else if (this.obj == null && this.cause != null) { this.obj = this.cause; diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java index 9b27c45a2..c12460cc9 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java @@ -10,6 +10,7 @@ import software.amazon.cryptography.materialproviders.model.EncryptedDataKey; public class ParsedHeader { + private final CryptoSchema cryptoSchema; private final DBEAlgorithmSuiteId algorithmSuiteId; @@ -62,7 +63,9 @@ public interface Builder { List encryptedDataKeys(); - Builder storedEncryptionContext(Map storedEncryptionContext); + Builder storedEncryptionContext( + Map storedEncryptionContext + ); Map storedEncryptionContext(); @@ -70,6 +73,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected CryptoSchema cryptoSchema; protected DBEAlgorithmSuiteId algorithmSuiteId; @@ -78,8 +82,7 @@ static class BuilderImpl implements Builder { protected Map storedEncryptionContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ParsedHeader model) { this.cryptoSchema = model.cryptoSchema(); @@ -115,7 +118,9 @@ public List encryptedDataKeys() { return this.encryptedDataKeys; } - public Builder storedEncryptionContext(Map storedEncryptionContext) { + public Builder storedEncryptionContext( + Map storedEncryptionContext + ) { this.storedEncryptionContext = storedEncryptionContext; return this; } @@ -125,17 +130,25 @@ public Map storedEncryptionContext() { } public ParsedHeader build() { - if (Objects.isNull(this.cryptoSchema())) { - throw new IllegalArgumentException("Missing value for required field `cryptoSchema`"); + if (Objects.isNull(this.cryptoSchema())) { + throw new IllegalArgumentException( + "Missing value for required field `cryptoSchema`" + ); } - if (Objects.isNull(this.algorithmSuiteId())) { - throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`"); + if (Objects.isNull(this.algorithmSuiteId())) { + throw new IllegalArgumentException( + "Missing value for required field `algorithmSuiteId`" + ); } - if (Objects.isNull(this.encryptedDataKeys())) { - throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`"); + if (Objects.isNull(this.encryptedDataKeys())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedDataKeys`" + ); } - if (Objects.isNull(this.storedEncryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `storedEncryptionContext`"); + if (Objects.isNull(this.storedEncryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `storedEncryptionContext`" + ); } return new ParsedHeader(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredData.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredData.java index 55fb8cb6a..d63dd4c58 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredData.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredData.java @@ -7,6 +7,7 @@ import java.util.Objects; public class StructuredData { + private final StructuredDataContent content; private final Map attributes; @@ -45,12 +46,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredDataContent content; protected Map attributes; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(StructuredData model) { this.content = model.content(); @@ -76,8 +77,10 @@ public Map attributes() { } public StructuredData build() { - if (Objects.isNull(this.content())) { - throw new IllegalArgumentException("Missing value for required field `content`"); + if (Objects.isNull(this.content())) { + throw new IllegalArgumentException( + "Missing value for required field `content`" + ); } return new StructuredData(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataContent.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataContent.java index 81f02cb3d..46fb82b77 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataContent.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataContent.java @@ -8,6 +8,7 @@ import java.util.Objects; public class StructuredDataContent { + private final StructuredDataTerminal Terminal; private final List DataList; @@ -57,14 +58,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredDataTerminal Terminal; protected List DataList; protected Map DataMap; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(StructuredDataContent model) { this.Terminal = model.Terminal(); @@ -101,13 +102,15 @@ public Map DataMap() { public StructuredDataContent build() { if (!onlyOneNonNull()) { - throw new IllegalArgumentException("`StructuredDataContent` is a Union. A Union MUST have one and only one value set."); + throw new IllegalArgumentException( + "`StructuredDataContent` is a Union. A Union MUST have one and only one value set." + ); } return new StructuredDataContent(this); } private boolean onlyOneNonNull() { - Object[] allValues = {this.Terminal, this.DataList, this.DataMap}; + Object[] allValues = { this.Terminal, this.DataList, this.DataMap }; boolean haveOneNonNull = false; for (Object o : allValues) { if (Objects.nonNull(o)) { diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataTerminal.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataTerminal.java index 8ba7f8d12..87a8676af 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataTerminal.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredDataTerminal.java @@ -7,6 +7,7 @@ import java.util.Objects; public class StructuredDataTerminal { + private final ByteBuffer value; private final ByteBuffer typeId; @@ -45,12 +46,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected ByteBuffer value; protected ByteBuffer typeId; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(StructuredDataTerminal model) { this.value = model.value(); @@ -76,17 +77,25 @@ public ByteBuffer typeId() { } public StructuredDataTerminal build() { - if (Objects.isNull(this.value())) { - throw new IllegalArgumentException("Missing value for required field `value`"); + if (Objects.isNull(this.value())) { + throw new IllegalArgumentException( + "Missing value for required field `value`" + ); } - if (Objects.isNull(this.typeId())) { - throw new IllegalArgumentException("Missing value for required field `typeId`"); + if (Objects.isNull(this.typeId())) { + throw new IllegalArgumentException( + "Missing value for required field `typeId`" + ); } if (Objects.nonNull(this.typeId()) && this.typeId().remaining() < 2) { - throw new IllegalArgumentException("The size of `typeId` must be greater than or equal to 2"); + throw new IllegalArgumentException( + "The size of `typeId` must be greater than or equal to 2" + ); } if (Objects.nonNull(this.typeId()) && this.typeId().remaining() > 2) { - throw new IllegalArgumentException("The size of `typeId` must be less than or equal to 2"); + throw new IllegalArgumentException( + "The size of `typeId` must be less than or equal to 2" + ); } return new StructuredDataTerminal(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionConfig.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionConfig.java index a722f14d2..138cc9c18 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionConfig.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionConfig.java @@ -4,8 +4,8 @@ package software.amazon.cryptography.dbencryptionsdk.structuredencryption.model; public class StructuredEncryptionConfig { - protected StructuredEncryptionConfig(BuilderImpl builder) { - } + + protected StructuredEncryptionConfig(BuilderImpl builder) {} public Builder toBuilder() { return new BuilderImpl(this); @@ -20,11 +20,10 @@ public interface Builder { } static class BuilderImpl implements Builder { - protected BuilderImpl() { - } - protected BuilderImpl(StructuredEncryptionConfig model) { - } + protected BuilderImpl() {} + + protected BuilderImpl(StructuredEncryptionConfig model) {} public StructuredEncryptionConfig build() { return new StructuredEncryptionConfig(this); diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionException.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionException.java index 280366d90..982a588de 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionException.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/StructuredEncryptionException.java @@ -6,6 +6,7 @@ import java.util.Objects; public class StructuredEncryptionException extends RuntimeException { + protected StructuredEncryptionException(BuilderImpl builder) { super(messageFromBuilder(builder), builder.cause()); } @@ -67,12 +68,12 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected String message; protected Throwable cause; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(StructuredEncryptionException model) { this.message = model.message(); @@ -98,8 +99,10 @@ public Throwable cause() { } public StructuredEncryptionException build() { - if (Objects.isNull(this.message())) { - throw new IllegalArgumentException("Missing value for required field `message`"); + if (Objects.isNull(this.message())) { + throw new IllegalArgumentException( + "Missing value for required field `message`" + ); } return new StructuredEncryptionException(this); } diff --git a/TestVectors/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/wrapped/TestDynamoDbEncryption.java b/TestVectors/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/wrapped/TestDynamoDbEncryption.java index 2abb50d9c..05609f445 100644 --- a/TestVectors/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/wrapped/TestDynamoDbEncryption.java +++ b/TestVectors/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/wrapped/TestDynamoDbEncryption.java @@ -16,6 +16,7 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbEncryptionClient; public class TestDynamoDbEncryption implements IDynamoDbEncryptionClient { + private final DynamoDbEncryption _impl; protected TestDynamoDbEncryption(BuilderImpl builder) { @@ -26,12 +27,19 @@ public static Builder builder() { return new BuilderImpl(); } - public Result CreateDynamoDbEncryptionBranchKeyIdSupplier( - CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyInput) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierInput nativeInput = ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(dafnyInput); + public Result< + CreateDynamoDbEncryptionBranchKeyIdSupplierOutput, + Error + > CreateDynamoDbEncryptionBranchKeyIdSupplier( + CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyInput + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierInput nativeInput = + ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(dafnyInput); try { - software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput nativeOutput = this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(nativeInput); - CreateDynamoDbEncryptionBranchKeyIdSupplierOutput dafnyOutput = ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(nativeOutput); + software.amazon.cryptography.dbencryptionsdk.dynamodb.model.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput nativeOutput = + this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(nativeInput); + CreateDynamoDbEncryptionBranchKeyIdSupplierOutput dafnyOutput = + ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(nativeOutput); return Result.create_Success(dafnyOutput); } catch (RuntimeException ex) { return Result.create_Failure(ToDafny.Error(ex)); @@ -47,10 +55,10 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DynamoDbEncryption impl; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder impl(DynamoDbEncryption impl) { this.impl = impl; @@ -62,8 +70,10 @@ public DynamoDbEncryption impl() { } public TestDynamoDbEncryption build() { - if (Objects.isNull(this.impl())) { - throw new IllegalArgumentException("Missing value for required field `impl`"); + if (Objects.isNull(this.impl())) { + throw new IllegalArgumentException( + "Missing value for required field `impl`" + ); } return new TestDynamoDbEncryption(this); } From 38f64036fd2c941d7c2e2140201ba41bb5f2d1ab Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:48:12 -0800 Subject: [PATCH 09/40] Check codegen of TestVectors too! --- .github/workflows/ci_codegen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_codegen.yml b/.github/workflows/ci_codegen.yml index 85b41f934..f835adc6c 100644 --- a/.github/workflows/ci_codegen.yml +++ b/.github/workflows/ci_codegen.yml @@ -14,6 +14,7 @@ jobs: library: [ DynamoDbEncryption, + TestVectors ] # Note dotnet is only used for formatting generated code # in this workflow From 2a85637c5c8df54094d4c7b043e625235b89e8cf Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:50:56 -0800 Subject: [PATCH 10/40] Manual edit -> patch file --- .../dotnet/dafny-4.2.0.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.2.0.patch diff --git a/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.2.0.patch b/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.2.0.patch new file mode 100644 index 000000000..e777b5f4a --- /dev/null +++ b/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.2.0.patch @@ -0,0 +1,48 @@ +diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +index 9a951767..5c0cee33 100644 +--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs ++++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +@@ -7,6 +7,43 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb + { + public static class TypeConversion + { ++ // BEGIN MANUAL EDIT ++ public static AWS.Cryptography.KeyStore.KeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_KeyStoreReference(software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient value) ++ { ++ if (value is software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient dafnyValue) ++ { ++ return new AWS.Cryptography.KeyStore.KeyStore(dafnyValue); ++ } ++ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet"); ++ } ++ public static software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_KeyStoreReference(AWS.Cryptography.KeyStore.KeyStore value) ++ { ++ if (value is AWS.Cryptography.KeyStore.KeyStore nativeValue) ++ { ++ return nativeValue.impl(); ++ } ++ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet"); ++ } ++ public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.ILegacyDynamoDbEncryptor FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S32_LegacyDynamoDbEncryptorReference(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor value) ++ { ++ if (value is NativeWrapper_LegacyDynamoDbEncryptor nativeWrapper) return nativeWrapper._impl; ++ return new LegacyDynamoDbEncryptor(value); ++ ++ } ++ public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S32_LegacyDynamoDbEncryptorReference(AWS.Cryptography.DbEncryptionSDK.DynamoDb.ILegacyDynamoDbEncryptor value) ++ { ++ switch (value) ++ { ++ case LegacyDynamoDbEncryptor valueWithImpl: ++ return valueWithImpl._impl; ++ case LegacyDynamoDbEncryptorBase nativeImpl: ++ return new NativeWrapper_LegacyDynamoDbEncryptor(nativeImpl); ++ default: ++ throw new System.ArgumentException( ++ "Custom implementations of LegacyDynamoDbEncryptor must extend LegacyDynamoDbEncryptorBase."); ++ } ++ } ++ // END MANUAL EDIT + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconKeySource value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource)value; From 1a47d6d786f10e7eacdb149d2ac07a75ace53e00 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 16:54:27 -0800 Subject: [PATCH 11/40] Fussy patch alignment --- .../Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy index 2aff57584..cb0d63baa 100644 --- a/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy +++ b/TestVectors/dafny/DDBEncryption/Model/AwsCryptographyDynamoDbEncryptionTypesWrapped.dfy @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" -// BEGIN MANUAL EDIT + // BEGIN MANUAL EDIT include "../../../../DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy" include "../../../../submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/KeyVectors/src/Index.dfy" -// END MANUAL EDIT + // END MANUAL EDIT abstract module WrappedAbstractAwsCryptographyDynamoDbEncryptionService { import opened Wrappers import opened StandardLibrary.UInt From 26ef683d19bd11f901a9069bde401e140d8b8920 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 7 Mar 2024 21:54:08 -0800 Subject: [PATCH 12/40] Wrong mpl path --- .github/actions/polymorph_codegen/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index fa68036b1..08174d9d5 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -61,7 +61,7 @@ runs: if: inputs.update-and-regenerate-mpl == 'true' shell: bash run: | - git submodule update --init --recursive --remote --merge mpl + git submodule update --init --recursive --remote --merge submodules/MaterialProviders - name: Don't regenerate dependencies unless requested id: dependencies @@ -84,10 +84,10 @@ runs: # Annoyingly, prettier has to be installed in each library individually. # And this is only necessary or even possible if we've updated the mpl submodule. run: | - make -C mpl/AwsCryptographyPrimitives setup_prettier - make -C mpl/AwsCryptographicMaterialProviders setup_prettier - make -C mpl/ComAmazonawsKms setup_prettier - make -C mpl/ComAmazonawsDynamodb setup_prettier + make -C submodules/MaterialProviders/AwsCryptographyPrimitives setup_prettier + make -C submodules/MaterialProviders/AwsCryptographicMaterialProviders setup_prettier + make -C submodules/MaterialProviders/ComAmazonawsKms setup_prettier + make -C submodules/MaterialProviders/ComAmazonawsDynamodb setup_prettier - name: Regenerate Java code using smithy-dafny # npx seems to be unavailable on Windows GHA runners, From ebc68c88a29f2e3b5d1a70823c3e6e70acd22829 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 09:44:38 -0800 Subject: [PATCH 13/40] Change StructuredEncryption client in Config back to concrete type --- ...tographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy | 4 ++-- DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy index 5f28ea398..3fbf6505e 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy @@ -40,11 +40,11 @@ module AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations refines Abs nameonly allowedUnsignedAttributes: Option, nameonly allowedUnsignedAttributePrefix: Option, nameonly algorithmSuiteId: Option, - nameonly structuredEncryption: StructuredEncryption.Types.IStructuredEncryptionClient, + nameonly structuredEncryption: StructuredEncryption.StructuredEncryptionClient, nameonly plaintextOverride: DDBE.PlaintextOverride, nameonly internalLegacyOverride: Option := None ) - + type InternalConfig = Config type ValidConfig = x : Config | ValidInternalConfig?(x) witness * diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy index 837b94584..22a5ffd54 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy @@ -135,8 +135,10 @@ module // Create the structured encryption client var structuredEncryptionRes := StructuredEncryption.StructuredEncryption(); - var structuredEncryption :- structuredEncryptionRes + var structuredEncryptionX : CSE.IStructuredEncryptionClient :- structuredEncryptionRes .MapFailure(e => AwsCryptographyDbEncryptionSdkDynamoDb(DDBE.AwsCryptographyDbEncryptionSdkStructuredEncryption(e))); + assert structuredEncryptionX is StructuredEncryption.StructuredEncryptionClient; + var structuredEncryption := structuredEncryptionX as StructuredEncryption.StructuredEncryptionClient; var cmm; if (config.cmm.Some?) { From 7505ffe7c601aa418d02cca7147c4ca46684dbf5 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 10:06:40 -0800 Subject: [PATCH 14/40] Necessary ensures --- DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy | 1 + 1 file changed, 1 insertion(+) diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy index 5700a2b9e..58136cdee 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy @@ -19,6 +19,7 @@ module method StructuredEncryption(config: StructuredEncryptionConfig) returns (res: Result) + ensures res.Success? ==> res.value is StructuredEncryptionClient { var maybePrimitives := Primitives.AtomicPrimitives(); var primitives :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); From 3544cabe57b2c1a0006d063057167f420ca13017 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 11:18:31 -0800 Subject: [PATCH 15/40] Different method for updating MPL --- .github/actions/polymorph_codegen/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 08174d9d5..31829a5c3 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -59,9 +59,11 @@ runs: steps: - name: Update MPL submodule locally if requested if: inputs.update-and-regenerate-mpl == 'true' + working-directory: submodules/MaterialProviders shell: bash run: | - git submodule update --init --recursive --remote --merge submodules/MaterialProviders + git checkout main + git pull - name: Don't regenerate dependencies unless requested id: dependencies From def50326ca3716673b7a0b1c5d364db600720722 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 11:50:30 -0800 Subject: [PATCH 16/40] Fix library path --- .github/workflows/ci_verification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_verification.yml b/.github/workflows/ci_verification.yml index ede4965a1..90865b666 100644 --- a/.github/workflows/ci_verification.yml +++ b/.github/workflows/ci_verification.yml @@ -58,7 +58,7 @@ jobs: uses: ./.github/actions/polymorph_codegen with: dafny: ${{ env.DAFNY_VERSION }} - library: ${{ matrix.service }} + library: DynamoDbEncryption/dafny/${{ matrix.service }} diff-generated-code: false update-and-regenerate-mpl: true From 609d3c5246009c0d42140df103499e5f1a6d2b55 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 11:59:47 -0800 Subject: [PATCH 17/40] Whoops --- .github/workflows/ci_verification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_verification.yml b/.github/workflows/ci_verification.yml index 90865b666..5086af96c 100644 --- a/.github/workflows/ci_verification.yml +++ b/.github/workflows/ci_verification.yml @@ -58,7 +58,7 @@ jobs: uses: ./.github/actions/polymorph_codegen with: dafny: ${{ env.DAFNY_VERSION }} - library: DynamoDbEncryption/dafny/${{ matrix.service }} + library: DynamoDbEncryption diff-generated-code: false update-and-regenerate-mpl: true From 31168abc35afe43297bbb12532dfb6fdce839cec Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 12:27:48 -0800 Subject: [PATCH 18/40] Submodule init --- .github/actions/polymorph_codegen/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 31829a5c3..2c6caba10 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -64,6 +64,7 @@ runs: run: | git checkout main git pull + git submodule update --init --recursive - name: Don't regenerate dependencies unless requested id: dependencies From a2ef35cab646c29b08dc8b5f5ade538dbfed8eae Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 14:31:37 -0800 Subject: [PATCH 19/40] More client changes --- .../dafny/DynamoDbEncryption/src/ConfigToInfo.dfy | 3 ++- .../DynamoDbEncryptionTransforms/src/Index.dfy | 4 +++- .../dafny/DynamoDbItemEncryptor/src/Index.dfy | 4 +++- ...bEncryptionSdkStructuredEncryptionOperations.dfy | 4 ++-- .../dafny/StructuredEncryption/src/Index.dfy | 13 +++++++++++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy index 69e80e25a..c034621f6 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy @@ -32,6 +32,7 @@ module SearchConfigToInfo { import CB = CompoundBeacon import SE = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes import MPT = AwsCryptographyMaterialProvidersTypes + import PT = AwsCryptographyPrimitivesTypes import Aws.Cryptography.Primitives // convert configured SearchConfig to internal SearchInfo @@ -96,7 +97,7 @@ module SearchConfigToInfo { outer : DynamoDbTableEncryptionConfig, keyStore : I.ValidStore, config : BeaconKeySource, - client: Primitives.AtomicPrimitivesClient + client: PT.IAwsCryptographicPrimitivesClient ) returns (output : Result) modifies client.Modifies diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy index 02b31d0f2..90967f7ad 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy @@ -183,8 +183,10 @@ module plaintextOverride := inputConfig.plaintextOverride ); var itemEncryptorRes := DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); - var itemEncryptor :- itemEncryptorRes + var itemEncryptorX: AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.IDynamoDbItemEncryptorClient :- itemEncryptorRes .MapFailure(e => AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor(e)); + assert itemEncryptorX is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; + var itemEncryptor := itemEncryptorX as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; var internalConfig: DdbMiddlewareConfig.ValidTableConfig := DdbMiddlewareConfig.TableConfig( physicalTableName := tableName, diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy index 22a5ffd54..fe6791daa 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy @@ -163,7 +163,9 @@ module var maybeCmpClient := MaterialProviders.MaterialProviders(); var internalLegacyOverride :- InternalLegacyOverride.InternalLegacyOverride.Build(config); - var cmpClient :- maybeCmpClient.MapFailure(e => AwsCryptographyMaterialProviders(e)); + var cmpClientX: AwsCryptographyMaterialProvidersTypes.IAwsCryptographicMaterialProvidersClient :- maybeCmpClient.MapFailure(e => AwsCryptographyMaterialProviders(e)); + assert cmpClientX is MaterialProviders.MaterialProvidersClient; + var cmpClient := cmpClientX as MaterialProviders.MaterialProvidersClient; //= specification/dynamodb-encryption-client/ddb-table-encryption-config.md#structure //# A [Legacy Config](#legacy-config) diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy index 6dd501fe9..790f777ef 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy @@ -33,8 +33,8 @@ module AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations refines Abst import Maps datatype Config = Config( - primitives : Primitives.AtomicPrimitivesClient, - materialProviders : MaterialProviders.MaterialProvidersClient + primitives : Prim.IAwsCryptographicPrimitivesClient, + materialProviders : CMP.IAwsCryptographicMaterialProvidersClient ) type InternalConfig = Config diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy index 58136cdee..7a5149a52 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy @@ -22,18 +22,27 @@ module ensures res.Success? ==> res.value is StructuredEncryptionClient { var maybePrimitives := Primitives.AtomicPrimitives(); - var primitives :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); + var primitivesX: AwsCryptographyPrimitivesTypes.IAwsCryptographicPrimitivesClient :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); + assert primitivesX is Primitives.AtomicPrimitivesClient; + var primitives := primitivesX as Primitives.AtomicPrimitivesClient; + var maybeMatProv := MaterialProviders.MaterialProviders(); - var matProv :- maybeMatProv.MapFailure(e => AwsCryptographyMaterialProviders(e)); + var matProvX: AwsCryptographyMaterialProvidersTypes.IAwsCryptographicMaterialProvidersClient :- maybeMatProv.MapFailure(e => AwsCryptographyMaterialProviders(e)); + assert matProvX is MaterialProviders.MaterialProvidersClient; + var matProv := matProvX as MaterialProviders.MaterialProvidersClient; + var client := new StructuredEncryptionClient(Operations.Config(primitives := primitives, materialProviders := matProv)); return Success(client); } + + class StructuredEncryptionClient... { predicate ValidState() { && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) && Modifies == Operations.ModifiesInternalConfig(config) + {History} } From a87c15e167a42cbc381ac0fbfb8b0ae8db47f42e Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 16:30:09 -0800 Subject: [PATCH 20/40] Revert config change --- .../dafny/DynamoDbEncryption/src/ConfigToInfo.dfy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy index c034621f6..8418209fd 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy @@ -97,7 +97,7 @@ module SearchConfigToInfo { outer : DynamoDbTableEncryptionConfig, keyStore : I.ValidStore, config : BeaconKeySource, - client: PT.IAwsCryptographicPrimitivesClient + client: Primitives.AtomicPrimitivesClient ) returns (output : Result) modifies client.Modifies @@ -179,7 +179,9 @@ module SearchConfigToInfo { :- Need(0 < |config.standardBeacons|, E("At least one standard beacon must be configured.")); var maybePrimitives := Primitives.AtomicPrimitives(); - var primitives :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); + var primitivesX: PT.IAwsCryptographicPrimitivesClient :- maybePrimitives.MapFailure(e => AwsCryptographyPrimitives(e)); + assert primitivesX is Primitives.AtomicPrimitivesClient; + var primitives := primitivesX as Primitives.AtomicPrimitivesClient; var source :- MakeKeySource(outer, config.keyStore, config.keySource, primitives); output := ConvertVersionWithSource(outer, config, source); } From 7628de5ccd6a326a3a62aed0d52d049ec17fe0ac Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 8 Mar 2024 16:46:09 -0800 Subject: [PATCH 21/40] Revert another config change --- ...ptographyDbEncryptionSdkStructuredEncryptionOperations.dfy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy index 790f777ef..6dd501fe9 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy @@ -33,8 +33,8 @@ module AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations refines Abst import Maps datatype Config = Config( - primitives : Prim.IAwsCryptographicPrimitivesClient, - materialProviders : CMP.IAwsCryptographicMaterialProvidersClient + primitives : Primitives.AtomicPrimitivesClient, + materialProviders : MaterialProviders.MaterialProvidersClient ) type InternalConfig = Config From 369e31e3da4c2afd88b3c9203da08f118600f0c2 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Sat, 9 Mar 2024 08:22:56 -0800 Subject: [PATCH 22/40] One more client cast fix --- .../dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy index fb9bff6fe..8726b7aed 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy @@ -210,7 +210,10 @@ module BeaconTestFixtures { ensures version.keyStore == output.store ensures fresh(output.client.Modifies) { - var client :- expect Primitives.AtomicPrimitives(); + var clientX: AwsCryptographyPrimitivesTypes.IAwsCryptographicPrimitivesClient :- expect Primitives.AtomicPrimitives(); + assert clientX is Primitives.AtomicPrimitivesClient; + var client := clientX as Primitives.AtomicPrimitivesClient; + var keyNameSet := set b <- version.standardBeacons :: b.name; var keyNames := SortedSets.ComputeSetToOrderedSequence2(keyNameSet, CharLess); var keys :- expect SI.GetHmacKeys(client, keyNames, keyNames, key); From 280cc2438d0f3a6095c82a78ca8cdb4be934a798 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Sat, 9 Mar 2024 10:21:45 -0800 Subject: [PATCH 23/40] Another client fix, a little help with an expensive assertion --- .../dafny/DynamoDbEncryption/test/Beacon.dfy | 5 ++++- ...ptionSdkStructuredEncryptionOperations.dfy | 20 +++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy index fe463a91d..4b5757aef 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy @@ -17,9 +17,12 @@ module TestBaseBeacon { import SI = SearchableEncryptionInfo import DDB = ComAmazonawsDynamodbTypes import SE = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyPrimitivesTypes method {:test} TestBeacon() { - var primitives :- expect Primitives.AtomicPrimitives(); + var primitivesX: AwsCryptographyPrimitivesTypes.IAwsCryptographicPrimitivesClient :- expect Primitives.AtomicPrimitives(); + assert primitivesX is Primitives.AtomicPrimitivesClient; + var primitives := primitivesX as Primitives.AtomicPrimitivesClient; var bb := BeaconBase(client := primitives, name := "foo", beaconName := "aws_dbe_b_foo"); var b := StandardBeacon(bb, 8, TermLocMap("foo"), false, false, None); diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy index 6dd501fe9..2d0e4634a 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy @@ -331,17 +331,17 @@ module AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations refines Abst LemmaInjectiveImpliesUniqueValues(fieldMap); } - Success( - EncryptCanonData( - encFields_c, - signedFields_c, - data_c, - CryptoSchema( - content := CryptoSchemaContent.SchemaMap(trimmedSchema), - attributes := None - ) + var canon := EncryptCanonData( + encFields_c, + signedFields_c, + data_c, + CryptoSchema( + content := CryptoSchemaContent.SchemaMap(trimmedSchema), + attributes := None ) - ) + ); + assert ValidEncryptCanon?(canon); + Success(canon) } // construct the DecryptCanon From 4b3252ccd27d191386e5f231730a11b1362e5670 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Sun, 10 Mar 2024 09:09:35 -0700 Subject: [PATCH 24/40] =?UTF-8?q?Convert=20really=20expensive=20=E2=80=9Ct?= =?UTF-8?q?est=20lemma=E2=80=9D=20to=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dafny/DynamoDbEncryption/src/Beacon.dfy | 13 ------------- .../dafny/DynamoDbEncryption/test/Beacon.dfy | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Beacon.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Beacon.dfy index 2ab32b296..e7704b2ee 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Beacon.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/src/Beacon.dfy @@ -439,17 +439,4 @@ module BaseBeacon { else [HexChar(TruncateNibble(bytes[0] % 16, topBits))] + ToHexString(bytes[1..]) } - - lemma {:vcs_split_on_every_assert} CheckBytesToHex() - ensures - && var bytes := [1,2,3,4,5,6,7,0xb7]; - && BytesToHex(bytes, 1) == "1" - && BytesToHex(bytes, 2) == "3" - && BytesToHex(bytes, 3) == "7" - && BytesToHex(bytes, 4) == "7" - && BytesToHex(bytes, 5) == "17" - && BytesToHex(bytes, 6) == "37" - && BytesToHex(bytes, 7) == "37" - && BytesToHex(bytes, 8) == "b7" - {} } diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy index 4b5757aef..d63238fc2 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy @@ -743,4 +743,20 @@ module TestBaseBeacon { var src := GetLiteralSource([1,2,3,4,5], version); var bv :- expect C.ConvertVersionWithSource(FullTableConfig, version, src); } + + method {:test} CheckBytesToHex() + { + var bytes := [1,2,3,4,5,6,7,0xb7]; + // These could be asserted instead, + // but they get too expensive + // on more recent versions of Dafny. + expect BytesToHex(bytes, 1) == "1"; + expect BytesToHex(bytes, 2) == "3"; + expect BytesToHex(bytes, 3) == "7"; + expect BytesToHex(bytes, 4) == "7"; + expect BytesToHex(bytes, 5) == "17"; + expect BytesToHex(bytes, 6) == "37"; + expect BytesToHex(bytes, 7) == "37"; + expect BytesToHex(bytes, 8) == "b7"; + {} } From 5f3aa61270c7866989aeefada0a2dba23553e595 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Sun, 10 Mar 2024 09:21:53 -0700 Subject: [PATCH 25/40] Typo --- DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy index d63238fc2..060438d9d 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy @@ -758,5 +758,5 @@ module TestBaseBeacon { expect BytesToHex(bytes, 6) == "37"; expect BytesToHex(bytes, 7) == "37"; expect BytesToHex(bytes, 8) == "b7"; - {} + } } From eaa8098991f274e4932ebb59646149cc6227c416 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 16:18:49 -0700 Subject: [PATCH 26/40] Merge checked-in and smithy-dafny generated properties --- .github/actions/polymorph_codegen/action.yml | 38 ++++++++++++++++++++ Makefile | 28 +++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 2c6caba10..a1b19df26 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -57,6 +57,44 @@ inputs: runs: using: "composite" steps: + # Update the project.properties file so that we pick up the right runtimes etc., + # in cases where inputs.dafny is different from the current value in that file. + - name: Generate smithy-dafny-project.properties file + env: + DAFNY_VERSION: ${{ inputs.dafny }} + shell: bash + run: | + make generate_properties_file + + - name: Read smithy-dafny-project.properties file + id: read_smithy_dafny_property + uses: christian-draeger/read-properties@1.1.1 + with: + path: "./smithy-dafny-project.properties" + properties: "dafnyVersion" + + - name: Read project.properties file + id: read_property + uses: christian-draeger/read-properties@1.1.1 + with: + path: "./smithy-dafny-project.properties" + properties: "projectJavaVersion mplDependencyJavaVersion smithyDafnyJavaConversionVersion" + + - name: Update top-level project.properties file + uses: christian-draeger/write-properties@1.1.0 + with: + path: "./project.properties" + property: | + 'projectJavaVersion' + 'mplDependencyJavaVersion' + 'dafnyRuntimeJavaVersion' + 'smithyDafnyJavaConversionVersion' + value: | + '${{ steps.read_property.outputs.projectJavaVersion }}' + '${{ steps.read_property.outputs.mplDependencyJavaVersion }}' + '${{ steps.read_smithy_dafny_property.outputs.dafnyVersion }}' + '${{ steps.read_property.outputs.smithyDafnyJavaConversionVersion }}' + - name: Update MPL submodule locally if requested if: inputs.update-and-regenerate-mpl == 'true' working-directory: submodules/MaterialProviders diff --git a/Makefile b/Makefile index c9349baec..ebb273121 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +PROJECT_ROOT := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))) + duvet: | duvet_extract duvet_report duvet_extract: @@ -12,3 +17,26 @@ duvet_report: --source-pattern "DynamoDbEncryption/dafny/**/*.smithy" \ --source-pattern "DynamoDbEncryption/runtimes/java/src/main/java/**/*.java" \ --html specification_compliance_report.html + +# Generate the top-level project.properties file using smithy-dafny. +# This is for the benefit of the nightly Dafny CI, +# to verify that everything works with the latest Dafny prerelease. +# We use smithy-dafny rather than just cat-ing the file directly +# because smithy-dafny currently maintains the knowledge +# of how Dafny release versions maps to Dafny runtime library versions, +# especially prerelease versions like 4.4.0-nightly-2024-01-30-908f95f. +# +# Note we generate to a different file than the checked-in project.properties, +# because in this repo that file has other properties as well, +# so we need to merge the two versions. +# See .github/actions/polymorph_codegen/action.yml. +generate_properties_file: + cd submodules/smithy-dafny/codegen/smithy-dafny-codegen-cli; \ + ./../gradlew run --args="\ + --dafny-version ${DAFNY_VERSION} \ + --library-root $(PROJECT_ROOT)/submodules/MaterialProviders/StandardLibrary \ + --model $(PROJECT_ROOT)/submodules/MaterialProviders/StandardLibrary/Model \ + --dependent-model $(PROJECT_ROOT)/submodules/MaterialProviders/StandardLibrary/Model \ + --namespace aws.polymorph \ + --properties-file $(PROJECT_ROOT)/smithy-dafny-project.properties \ + "; From 8d0d273cb0bf309e235022f37c489b90c5d9d73c Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 16:21:53 -0700 Subject: [PATCH 27/40] Ordering --- .github/actions/polymorph_codegen/action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index a1b19df26..866327bbd 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -57,6 +57,15 @@ inputs: runs: using: "composite" steps: + - name: Update MPL submodule locally if requested + if: inputs.update-and-regenerate-mpl == 'true' + working-directory: submodules/MaterialProviders + shell: bash + run: | + git checkout main + git pull + git submodule update --init --recursive + # Update the project.properties file so that we pick up the right runtimes etc., # in cases where inputs.dafny is different from the current value in that file. - name: Generate smithy-dafny-project.properties file @@ -95,15 +104,6 @@ runs: '${{ steps.read_smithy_dafny_property.outputs.dafnyVersion }}' '${{ steps.read_property.outputs.smithyDafnyJavaConversionVersion }}' - - name: Update MPL submodule locally if requested - if: inputs.update-and-regenerate-mpl == 'true' - working-directory: submodules/MaterialProviders - shell: bash - run: | - git checkout main - git pull - git submodule update --init --recursive - - name: Don't regenerate dependencies unless requested id: dependencies shell: bash From 70dbd8e6bfc410e39ae073430760163df3d5a37d Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 17:06:19 -0700 Subject: [PATCH 28/40] Use awk instead --- .github/actions/polymorph_codegen/action.yml | 31 +++----------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 866327bbd..b3468c9d7 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -75,34 +75,11 @@ runs: run: | make generate_properties_file - - name: Read smithy-dafny-project.properties file - id: read_smithy_dafny_property - uses: christian-draeger/read-properties@1.1.1 - with: - path: "./smithy-dafny-project.properties" - properties: "dafnyVersion" - - - name: Read project.properties file - id: read_property - uses: christian-draeger/read-properties@1.1.1 - with: - path: "./smithy-dafny-project.properties" - properties: "projectJavaVersion mplDependencyJavaVersion smithyDafnyJavaConversionVersion" - - name: Update top-level project.properties file - uses: christian-draeger/write-properties@1.1.0 - with: - path: "./project.properties" - property: | - 'projectJavaVersion' - 'mplDependencyJavaVersion' - 'dafnyRuntimeJavaVersion' - 'smithyDafnyJavaConversionVersion' - value: | - '${{ steps.read_property.outputs.projectJavaVersion }}' - '${{ steps.read_property.outputs.mplDependencyJavaVersion }}' - '${{ steps.read_smithy_dafny_property.outputs.dafnyVersion }}' - '${{ steps.read_property.outputs.smithyDafnyJavaConversionVersion }}' + shell: bash + run: | + awk -F= '!a[$1]++' smithy-dafny-project.properties project.properties > merged.properties + mv merged.properties project.properties - name: Don't regenerate dependencies unless requested id: dependencies From 146d26e9b9e8b8b4f9e2a182c0460fe086ad0422 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 17:28:00 -0700 Subject: [PATCH 29/40] Debugging --- .github/actions/polymorph_codegen/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index b3468c9d7..5d9cf3787 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -80,6 +80,7 @@ runs: run: | awk -F= '!a[$1]++' smithy-dafny-project.properties project.properties > merged.properties mv merged.properties project.properties + cat project.properties - name: Don't regenerate dependencies unless requested id: dependencies From 280d6ad30a3fcde4d081d6a779db9f8cbb30188e Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 17:40:31 -0700 Subject: [PATCH 30/40] Update smithy-dafny --- submodules/smithy-dafny | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/smithy-dafny b/submodules/smithy-dafny index 16a8b6998..4176c8df9 160000 --- a/submodules/smithy-dafny +++ b/submodules/smithy-dafny @@ -1 +1 @@ -Subproject commit 16a8b699860edbffff3c3339dfccf046e3ccf213 +Subproject commit 4176c8df9a4758aeb548b90ee4ba82147b265e60 From 59ce0e57641825feca2368a771f5406fa7ac3924 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 21 Mar 2024 17:59:16 -0700 Subject: [PATCH 31/40] Update smithy-dafny --- submodules/smithy-dafny | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/smithy-dafny b/submodules/smithy-dafny index 4176c8df9..9994703ac 160000 --- a/submodules/smithy-dafny +++ b/submodules/smithy-dafny @@ -1 +1 @@ -Subproject commit 4176c8df9a4758aeb548b90ee4ba82147b265e60 +Subproject commit 9994703ac3dfd29f24083eab17fadc130ff45b38 From 3deea7820d9f3b8c8a5152d1e494abeb365c1e30 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 25 Mar 2024 09:54:03 -0700 Subject: [PATCH 32/40] update project.properties in MPL too --- .github/actions/polymorph_codegen/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 5d9cf3787..1051743e6 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -66,6 +66,13 @@ runs: git pull git submodule update --init --recursive + - name: Update top-level project.properties file in MPL + if: inputs.update-and-regenerate-mpl == 'true' + shell: bash + working-directory: submodules/MaterialProviders + run: | + make generate_properties_file + # Update the project.properties file so that we pick up the right runtimes etc., # in cases where inputs.dafny is different from the current value in that file. - name: Generate smithy-dafny-project.properties file From 8f4c4531f33377fadd01f79e3536f048505ce8b5 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 25 Mar 2024 17:18:23 -0700 Subject: [PATCH 33/40] Regenerate code after merge --- ...yptographyDbEncryptionSdkDynamoDbTypes.dfy | 1062 ++--- ...DbEncryptionSdkDynamoDbTransformsTypes.dfy | 3514 ++++++++--------- ...ncryptionSdkDynamoDbItemEncryptorTypes.dfy | 596 +-- ...EncryptionSdkStructuredEncryptionTypes.dfy | 664 ++-- .../dynamodb/DynamoDbEncryption.java | 41 +- .../itemencryptor/DynamoDbItemEncryptor.java | 40 +- .../dynamodb/itemencryptor/ToDafny.java | 262 +- .../dynamodb/itemencryptor/ToNative.java | 205 +- .../itemencryptor/model/ParsedHeader.java | 61 +- .../DynamoDbEncryptionTransforms.java | 350 +- .../StructuredEncryption.java | 40 +- .../structuredencryption/ToDafny.java | 524 ++- .../structuredencryption/ToNative.java | 402 +- .../model/CryptoAction.java | 4 +- .../model/ParsedHeader.java | 43 +- .../DynamoDbEncryption/TypeConversion.cs | 13 +- .../TypeConversion.cs | 13 +- .../DynamoDbItemEncryptor/TypeConversion.cs | 30 +- 18 files changed, 4400 insertions(+), 3464 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy index 9d2bbb34e..eda70a9d0 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy @@ -2,543 +2,543 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyKeyStoreTypes - import AwsCryptographyPrimitivesTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype AsSet = | AsSet ( - - ) - type AttributeActions = map - type BeaconBitLength = x: int32 | IsValid_BeaconBitLength(x) witness * - predicate method IsValid_BeaconBitLength(x: int32) { - ( 1 <= x <= 63 ) -} - datatype BeaconKeySource = - | single(single: SingleKeyStore) - | multi(multi: MultiKeyStore) - datatype BeaconStyle = - | partOnly(partOnly: PartOnly) - | shared(shared: Shared) - | asSet(asSet: AsSet) - | sharedSet(sharedSet: SharedSet) - datatype BeaconVersion = | BeaconVersion ( - nameonly version: VersionNumber , - nameonly keyStore: AwsCryptographyKeyStoreTypes.IKeyStoreClient , - nameonly keySource: BeaconKeySource , - nameonly standardBeacons: StandardBeaconList , - nameonly compoundBeacons: Option := Option.None , - nameonly virtualFields: Option := Option.None , - nameonly encryptedParts: Option := Option.None , - nameonly signedParts: Option := Option.None - ) - type BeaconVersionList = x: seq | IsValid_BeaconVersionList(x) witness * - predicate method IsValid_BeaconVersionList(x: seq) { - ( 1 <= |x| <= 1 ) -} - type Char = x: string | IsValid_Char(x) witness * - predicate method IsValid_Char(x: string) { - ( 1 <= |x| <= 1 ) -} - datatype CompoundBeacon = | CompoundBeacon ( - nameonly name: string , - nameonly split: Char , - nameonly encrypted: Option := Option.None , - nameonly signed: Option := Option.None , - nameonly constructors: Option := Option.None - ) - type CompoundBeaconList = x: seq | IsValid_CompoundBeaconList(x) witness * - predicate method IsValid_CompoundBeaconList(x: seq) { - ( 1 <= |x| ) -} - datatype Constructor = | Constructor ( - nameonly parts: ConstructorPartList - ) - type ConstructorList = x: seq | IsValid_ConstructorList(x) witness * - predicate method IsValid_ConstructorList(x: seq) { - ( 1 <= |x| ) -} - datatype ConstructorPart = | ConstructorPart ( - nameonly name: string , - nameonly required: bool - ) - type ConstructorPartList = x: seq | IsValid_ConstructorPartList(x) witness * - predicate method IsValid_ConstructorPartList(x: seq) { - ( 1 <= |x| ) -} - datatype CreateDynamoDbEncryptionBranchKeyIdSupplierInput = | CreateDynamoDbEncryptionBranchKeyIdSupplierInput ( - nameonly ddbKeyBranchKeyIdSupplier: IDynamoDbKeyBranchKeyIdSupplier - ) - datatype CreateDynamoDbEncryptionBranchKeyIdSupplierOutput = | CreateDynamoDbEncryptionBranchKeyIdSupplierOutput ( - nameonly branchKeyIdSupplier: AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier - ) - class IDynamoDbEncryptionClientCallHistory { - ghost constructor() { - CreateDynamoDbEncryptionBranchKeyIdSupplier := []; -} - ghost var CreateDynamoDbEncryptionBranchKeyIdSupplier: seq>> -} - trait {:termination false} IDynamoDbEncryptionClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyKeyStoreTypes + import AwsCryptographyPrimitivesTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbEncryptionClientCallHistory - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - // The public method to be called by library consumers - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidState() - && input.ddbKeyBranchKeyIdSupplier.ValidState() - && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} - modifies Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies , - History`CreateDynamoDbEncryptionBranchKeyIdSupplier - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidState() - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && output.value.branchKeyIdSupplier.Modifies !! {History} - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) - ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] - -} - datatype DynamoDbEncryptionConfig = | DynamoDbEncryptionConfig ( - - ) - class IDynamoDbKeyBranchKeyIdSupplierCallHistory { - ghost constructor() { - GetBranchKeyIdFromDdbKey := []; -} - ghost var GetBranchKeyIdFromDdbKey: seq>> -} - trait {:termination false} IDynamoDbKeyBranchKeyIdSupplier - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; + // Begin Generated Types - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbKeyBranchKeyIdSupplierCallHistory - predicate GetBranchKeyIdFromDdbKeyEnsuresPublicly(input: GetBranchKeyIdFromDdbKeyInput , output: Result) - // The public method to be called by library consumers - method GetBranchKeyIdFromDdbKey ( input: GetBranchKeyIdFromDdbKeyInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetBranchKeyIdFromDdbKey - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) - ensures History.GetBranchKeyIdFromDdbKey == old(History.GetBranchKeyIdFromDdbKey) + [DafnyCallEvent(input, output)] - { - output := GetBranchKeyIdFromDdbKey' (input); - History.GetBranchKeyIdFromDdbKey := History.GetBranchKeyIdFromDdbKey + [DafnyCallEvent(input, output)]; -} - // The method to implement in the concrete class. - method GetBranchKeyIdFromDdbKey' ( input: GetBranchKeyIdFromDdbKeyInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) - ensures unchanged(History) - -} - datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig ( - nameonly logicalTableName: string , - nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , - nameonly sortKeyName: Option := Option.None , - nameonly search: Option := Option.None , - nameonly attributeActionsOnEncrypt: AttributeActions , - nameonly allowedUnsignedAttributes: Option := Option.None , - nameonly allowedUnsignedAttributePrefix: Option := Option.None , - nameonly algorithmSuiteId: Option := Option.None , - nameonly keyring: Option := Option.None , - nameonly cmm: Option := Option.None , - nameonly legacyOverride: Option := Option.None , - nameonly plaintextOverride: Option := Option.None - ) - type DynamoDbTableEncryptionConfigList = map - datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig ( - nameonly tableEncryptionConfigs: DynamoDbTableEncryptionConfigList - ) - datatype EncryptedPart = | EncryptedPart ( - nameonly name: string , - nameonly prefix: Prefix - ) - type EncryptedPartsList = x: seq | IsValid_EncryptedPartsList(x) witness * - predicate method IsValid_EncryptedPartsList(x: seq) { - ( 1 <= |x| ) -} - datatype GetBranchKeyIdFromDdbKeyInput = | GetBranchKeyIdFromDdbKeyInput ( - nameonly ddbKey: ComAmazonawsDynamodbTypes.Key - ) - datatype GetBranchKeyIdFromDdbKeyOutput = | GetBranchKeyIdFromDdbKeyOutput ( - nameonly branchKeyId: string - ) - datatype GetPrefix = | GetPrefix ( - nameonly length: int32 - ) - datatype GetSegment = | GetSegment ( - nameonly split: Char , - nameonly index: int32 - ) - datatype GetSegments = | GetSegments ( - nameonly split: Char , - nameonly low: int32 , - nameonly high: int32 - ) - datatype GetSubstring = | GetSubstring ( - nameonly low: int32 , - nameonly high: int32 - ) - datatype GetSuffix = | GetSuffix ( - nameonly length: int32 - ) - datatype Insert = | Insert ( - nameonly literal: string - ) - class ILegacyDynamoDbEncryptorCallHistory { - ghost constructor() { - -} - -} - trait {:termination false} ILegacyDynamoDbEncryptor - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; + datatype AsSet = | AsSet ( - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: ILegacyDynamoDbEncryptorCallHistory - -} - datatype LegacyOverride = | LegacyOverride ( - nameonly policy: LegacyPolicy , - nameonly encryptor: ILegacyDynamoDbEncryptor , - nameonly attributeActionsOnEncrypt: AttributeActions , - nameonly defaultAttributeFlag: Option := Option.None - ) - datatype LegacyPolicy = - | FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT - | FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT - | FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT - datatype Lower = | Lower ( - - ) - datatype MultiKeyStore = | MultiKeyStore ( - nameonly keyFieldName: string , - nameonly cacheTTL: int32 , - nameonly cache: Option := Option.None - ) - datatype PartOnly = | PartOnly ( - - ) - datatype PlaintextOverride = - | FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ - | FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ - | FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ - type Prefix = x: string | IsValid_Prefix(x) witness * - predicate method IsValid_Prefix(x: string) { - ( 1 <= |x| ) -} - datatype SearchConfig = | SearchConfig ( - nameonly versions: BeaconVersionList , - nameonly writeVersion: VersionNumber - ) - datatype Shared = | Shared ( - nameonly other: string - ) - datatype SharedSet = | SharedSet ( - nameonly other: string - ) - datatype SignedPart = | SignedPart ( - nameonly name: string , - nameonly prefix: Prefix , - nameonly loc: Option := Option.None - ) - type SignedPartsList = x: seq | IsValid_SignedPartsList(x) witness * - predicate method IsValid_SignedPartsList(x: seq) { - ( 1 <= |x| ) -} - datatype SingleKeyStore = | SingleKeyStore ( - nameonly keyId: string , - nameonly cacheTTL: int32 - ) - datatype StandardBeacon = | StandardBeacon ( - nameonly name: string , - nameonly length: BeaconBitLength , - nameonly loc: Option := Option.None , - nameonly style: Option := Option.None - ) - type StandardBeaconList = x: seq | IsValid_StandardBeaconList(x) witness * - predicate method IsValid_StandardBeaconList(x: seq) { - ( 1 <= |x| ) -} - type TerminalLocation = x: string | IsValid_TerminalLocation(x) witness * - predicate method IsValid_TerminalLocation(x: string) { - ( 1 <= |x| ) -} - datatype Upper = | Upper ( - - ) - type VersionNumber = x: int32 | IsValid_VersionNumber(x) witness * - predicate method IsValid_VersionNumber(x: int32) { - ( 1 <= x ) -} - datatype VirtualField = | VirtualField ( - nameonly name: string , - nameonly parts: VirtualPartList - ) - type VirtualFieldList = x: seq | IsValid_VirtualFieldList(x) witness * - predicate method IsValid_VirtualFieldList(x: seq) { - ( 1 <= |x| ) -} - datatype VirtualPart = | VirtualPart ( - nameonly loc: TerminalLocation , - nameonly trans: Option := Option.None - ) - type VirtualPartList = x: seq | IsValid_VirtualPartList(x) witness * - predicate method IsValid_VirtualPartList(x: seq) { - ( 1 <= |x| ) -} - datatype VirtualTransform = - | upper(upper: Upper) - | lower(lower: Lower) - | insert(insert: Insert) - | prefix(prefix: GetPrefix) - | suffix(suffix: GetSuffix) - | substring(substring: GetSubstring) - | segment(segment: GetSegment) - | segments(segments: GetSegments) - type VirtualTransformList = x: seq | IsValid_VirtualTransformList(x) witness * - predicate method IsValid_VirtualTransformList(x: seq) { - ( 1 <= |x| ) -} - datatype Error = - // Local Error structures are listed here - | DynamoDbEncryptionException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyKeyStore(AwsCryptographyKeyStore: AwsCryptographyKeyStoreTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations - function method DefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig - method DynamoDbEncryption(config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() + ) + type AttributeActions = map + type BeaconBitLength = x: int32 | IsValid_BeaconBitLength(x) witness * + predicate method IsValid_BeaconBitLength(x: int32) { + ( 1 <= x <= 63 ) + } + datatype BeaconKeySource = + | single(single: SingleKeyStore) + | multi(multi: MultiKeyStore) + datatype BeaconStyle = + | partOnly(partOnly: PartOnly) + | shared(shared: Shared) + | asSet(asSet: AsSet) + | sharedSet(sharedSet: SharedSet) + datatype BeaconVersion = | BeaconVersion ( + nameonly version: VersionNumber , + nameonly keyStore: AwsCryptographyKeyStoreTypes.IKeyStoreClient , + nameonly keySource: BeaconKeySource , + nameonly standardBeacons: StandardBeaconList , + nameonly compoundBeacons: Option := Option.None , + nameonly virtualFields: Option := Option.None , + nameonly encryptedParts: Option := Option.None , + nameonly signedParts: Option := Option.None + ) + type BeaconVersionList = x: seq | IsValid_BeaconVersionList(x) witness * + predicate method IsValid_BeaconVersionList(x: seq) { + ( 1 <= |x| <= 1 ) + } + type Char = x: string | IsValid_Char(x) witness * + predicate method IsValid_Char(x: string) { + ( 1 <= |x| <= 1 ) + } + datatype CompoundBeacon = | CompoundBeacon ( + nameonly name: string , + nameonly split: Char , + nameonly encrypted: Option := Option.None , + nameonly signed: Option := Option.None , + nameonly constructors: Option := Option.None + ) + type CompoundBeaconList = x: seq | IsValid_CompoundBeaconList(x) witness * + predicate method IsValid_CompoundBeaconList(x: seq) { + ( 1 <= |x| ) + } + datatype Constructor = | Constructor ( + nameonly parts: ConstructorPartList + ) + type ConstructorList = x: seq | IsValid_ConstructorList(x) witness * + predicate method IsValid_ConstructorList(x: seq) { + ( 1 <= |x| ) + } + datatype ConstructorPart = | ConstructorPart ( + nameonly name: string , + nameonly required: bool + ) + type ConstructorPartList = x: seq | IsValid_ConstructorPartList(x) witness * + predicate method IsValid_ConstructorPartList(x: seq) { + ( 1 <= |x| ) + } + datatype CreateDynamoDbEncryptionBranchKeyIdSupplierInput = | CreateDynamoDbEncryptionBranchKeyIdSupplierInput ( + nameonly ddbKeyBranchKeyIdSupplier: IDynamoDbKeyBranchKeyIdSupplier + ) + datatype CreateDynamoDbEncryptionBranchKeyIdSupplierOutput = | CreateDynamoDbEncryptionBranchKeyIdSupplierOutput ( + nameonly branchKeyIdSupplier: AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier + ) + class IDynamoDbEncryptionClientCallHistory { + ghost constructor() { + CreateDynamoDbEncryptionBranchKeyIdSupplier := []; + } + ghost var CreateDynamoDbEncryptionBranchKeyIdSupplier: seq>> + } + trait {:termination false} IDynamoDbEncryptionClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; - // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals - function method CreateSuccessOfClient(client: IDynamoDbEncryptionClient): Result { - Success(client) - } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals - function method CreateFailureOfError(error: Error): Result { - Failure(error) - } - class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - {Operations.CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidState() - && input.ddbKeyBranchKeyIdSupplier.ValidState() - && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} - modifies Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies , - History`CreateDynamoDbEncryptionBranchKeyIdSupplier - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidState() - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && output.value.branchKeyIdSupplier.Modifies !! {History} - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) - ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] - { - output := Operations.CreateDynamoDbEncryptionBranchKeyIdSupplier(config, input); - History.CreateDynamoDbEncryptionBranchKeyIdSupplier := History.CreateDynamoDbEncryptionBranchKeyIdSupplier + [DafnyCallEvent(input, output)]; -} - + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbEncryptionClientCallHistory + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + // The public method to be called by library consumers + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidState() + && input.ddbKeyBranchKeyIdSupplier.ValidState() + && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} + modifies Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies , + History`CreateDynamoDbEncryptionBranchKeyIdSupplier + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidState() + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && output.value.branchKeyIdSupplier.Modifies !! {History} + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] + + } + datatype DynamoDbEncryptionConfig = | DynamoDbEncryptionConfig ( + + ) + class IDynamoDbKeyBranchKeyIdSupplierCallHistory { + ghost constructor() { + GetBranchKeyIdFromDdbKey := []; + } + ghost var GetBranchKeyIdFromDdbKey: seq>> + } + trait {:termination false} IDynamoDbKeyBranchKeyIdSupplier + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbKeyBranchKeyIdSupplierCallHistory + predicate GetBranchKeyIdFromDdbKeyEnsuresPublicly(input: GetBranchKeyIdFromDdbKeyInput , output: Result) + // The public method to be called by library consumers + method GetBranchKeyIdFromDdbKey ( input: GetBranchKeyIdFromDdbKeyInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetBranchKeyIdFromDdbKey + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) + ensures History.GetBranchKeyIdFromDdbKey == old(History.GetBranchKeyIdFromDdbKey) + [DafnyCallEvent(input, output)] + { + output := GetBranchKeyIdFromDdbKey' (input); + History.GetBranchKeyIdFromDdbKey := History.GetBranchKeyIdFromDdbKey + [DafnyCallEvent(input, output)]; + } + // The method to implement in the concrete class. + method GetBranchKeyIdFromDdbKey' ( input: GetBranchKeyIdFromDdbKeyInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetBranchKeyIdFromDdbKeyEnsuresPublicly(input, output) + ensures unchanged(History) + + } + datatype DynamoDbTableEncryptionConfig = | DynamoDbTableEncryptionConfig ( + nameonly logicalTableName: string , + nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , + nameonly sortKeyName: Option := Option.None , + nameonly search: Option := Option.None , + nameonly attributeActionsOnEncrypt: AttributeActions , + nameonly allowedUnsignedAttributes: Option := Option.None , + nameonly allowedUnsignedAttributePrefix: Option := Option.None , + nameonly algorithmSuiteId: Option := Option.None , + nameonly keyring: Option := Option.None , + nameonly cmm: Option := Option.None , + nameonly legacyOverride: Option := Option.None , + nameonly plaintextOverride: Option := Option.None + ) + type DynamoDbTableEncryptionConfigList = map + datatype DynamoDbTablesEncryptionConfig = | DynamoDbTablesEncryptionConfig ( + nameonly tableEncryptionConfigs: DynamoDbTableEncryptionConfigList + ) + datatype EncryptedPart = | EncryptedPart ( + nameonly name: string , + nameonly prefix: Prefix + ) + type EncryptedPartsList = x: seq | IsValid_EncryptedPartsList(x) witness * + predicate method IsValid_EncryptedPartsList(x: seq) { + ( 1 <= |x| ) + } + datatype GetBranchKeyIdFromDdbKeyInput = | GetBranchKeyIdFromDdbKeyInput ( + nameonly ddbKey: ComAmazonawsDynamodbTypes.Key + ) + datatype GetBranchKeyIdFromDdbKeyOutput = | GetBranchKeyIdFromDdbKeyOutput ( + nameonly branchKeyId: string + ) + datatype GetPrefix = | GetPrefix ( + nameonly length: int32 + ) + datatype GetSegment = | GetSegment ( + nameonly split: Char , + nameonly index: int32 + ) + datatype GetSegments = | GetSegments ( + nameonly split: Char , + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSubstring = | GetSubstring ( + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSuffix = | GetSuffix ( + nameonly length: int32 + ) + datatype Insert = | Insert ( + nameonly literal: string + ) + class ILegacyDynamoDbEncryptorCallHistory { + ghost constructor() { + + } + + } + trait {:termination false} ILegacyDynamoDbEncryptor + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: ILegacyDynamoDbEncryptorCallHistory + + } + datatype LegacyOverride = | LegacyOverride ( + nameonly policy: LegacyPolicy , + nameonly encryptor: ILegacyDynamoDbEncryptor , + nameonly attributeActionsOnEncrypt: AttributeActions , + nameonly defaultAttributeFlag: Option := Option.None + ) + datatype LegacyPolicy = + | FORCE_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT + | FORBID_LEGACY_ENCRYPT_ALLOW_LEGACY_DECRYPT + | FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT + datatype Lower = | Lower ( + + ) + datatype MultiKeyStore = | MultiKeyStore ( + nameonly keyFieldName: string , + nameonly cacheTTL: int32 , + nameonly cache: Option := Option.None + ) + datatype PartOnly = | PartOnly ( + + ) + datatype PlaintextOverride = + | FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ + | FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ + | FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ + type Prefix = x: string | IsValid_Prefix(x) witness * + predicate method IsValid_Prefix(x: string) { + ( 1 <= |x| ) + } + datatype SearchConfig = | SearchConfig ( + nameonly versions: BeaconVersionList , + nameonly writeVersion: VersionNumber + ) + datatype Shared = | Shared ( + nameonly other: string + ) + datatype SharedSet = | SharedSet ( + nameonly other: string + ) + datatype SignedPart = | SignedPart ( + nameonly name: string , + nameonly prefix: Prefix , + nameonly loc: Option := Option.None + ) + type SignedPartsList = x: seq | IsValid_SignedPartsList(x) witness * + predicate method IsValid_SignedPartsList(x: seq) { + ( 1 <= |x| ) + } + datatype SingleKeyStore = | SingleKeyStore ( + nameonly keyId: string , + nameonly cacheTTL: int32 + ) + datatype StandardBeacon = | StandardBeacon ( + nameonly name: string , + nameonly length: BeaconBitLength , + nameonly loc: Option := Option.None , + nameonly style: Option := Option.None + ) + type StandardBeaconList = x: seq | IsValid_StandardBeaconList(x) witness * + predicate method IsValid_StandardBeaconList(x: seq) { + ( 1 <= |x| ) + } + type TerminalLocation = x: string | IsValid_TerminalLocation(x) witness * + predicate method IsValid_TerminalLocation(x: string) { + ( 1 <= |x| ) + } + datatype Upper = | Upper ( + + ) + type VersionNumber = x: int32 | IsValid_VersionNumber(x) witness * + predicate method IsValid_VersionNumber(x: int32) { + ( 1 <= x ) + } + datatype VirtualField = | VirtualField ( + nameonly name: string , + nameonly parts: VirtualPartList + ) + type VirtualFieldList = x: seq | IsValid_VirtualFieldList(x) witness * + predicate method IsValid_VirtualFieldList(x: seq) { + ( 1 <= |x| ) + } + datatype VirtualPart = | VirtualPart ( + nameonly loc: TerminalLocation , + nameonly trans: Option := Option.None + ) + type VirtualPartList = x: seq | IsValid_VirtualPartList(x) witness * + predicate method IsValid_VirtualPartList(x: seq) { + ( 1 <= |x| ) + } + datatype VirtualTransform = + | upper(upper: Upper) + | lower(lower: Lower) + | insert(insert: Insert) + | prefix(prefix: GetPrefix) + | suffix(suffix: GetSuffix) + | substring(substring: GetSubstring) + | segment(segment: GetSegment) + | segments(segments: GetSegments) + type VirtualTransformList = x: seq | IsValid_VirtualTransformList(x) witness * + predicate method IsValid_VirtualTransformList(x: seq) { + ( 1 <= |x| ) + } + datatype Error = + // Local Error structures are listed here + | DynamoDbEncryptionException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyKeyStore(AwsCryptographyKeyStore: AwsCryptographyKeyStoreTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations + function method DefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig + method DynamoDbEncryption(config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbEncryptionClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbEncryptionClient extends IDynamoDbEncryptionClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + {Operations.CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidState() + && input.ddbKeyBranchKeyIdSupplier.ValidState() + && input.ddbKeyBranchKeyIdSupplier.Modifies !! {History} + modifies Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies , + History`CreateDynamoDbEncryptionBranchKeyIdSupplier + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidState() + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && output.value.branchKeyIdSupplier.Modifies !! {History} + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - Modifies - {History} - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + ensures History.CreateDynamoDbEncryptionBranchKeyIdSupplier == old(History.CreateDynamoDbEncryptionBranchKeyIdSupplier) + [DafnyCallEvent(input, output)] + { + output := Operations.CreateDynamoDbEncryptionBranchKeyIdSupplier(config, input); + History.CreateDynamoDbEncryptionBranchKeyIdSupplier := History.CreateDynamoDbEncryptionBranchKeyIdSupplier + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput , output: Result) + // The private method to be refined by the library developer - method CreateDynamoDbEncryptionBranchKeyIdSupplier ( config: InternalConfig , input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.ddbKeyBranchKeyIdSupplier.ValidState() - modifies ModifiesInternalConfig(config) , - input.ddbKeyBranchKeyIdSupplier.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.ddbKeyBranchKeyIdSupplier.Modifies - ensures - && ValidInternalConfig?(config) - && ( output.Success? ==> - && output.value.branchKeyIdSupplier.ValidState() - && fresh(output.value.branchKeyIdSupplier) - && fresh ( output.value.branchKeyIdSupplier.Modifies - ModifiesInternalConfig(config) - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) - ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) + method CreateDynamoDbEncryptionBranchKeyIdSupplier ( config: InternalConfig , input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.ddbKeyBranchKeyIdSupplier.ValidState() + modifies ModifiesInternalConfig(config) , + input.ddbKeyBranchKeyIdSupplier.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.ddbKeyBranchKeyIdSupplier.Modifies + ensures + && ValidInternalConfig?(config) + && ( output.Success? ==> + && output.value.branchKeyIdSupplier.ValidState() + && fresh(output.value.branchKeyIdSupplier) + && fresh ( output.value.branchKeyIdSupplier.Modifies - ModifiesInternalConfig(config) - input.ddbKeyBranchKeyIdSupplier.Modifies ) ) + ensures CreateDynamoDbEncryptionBranchKeyIdSupplierEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy index 87da7669b..6bca0c2f9 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy @@ -2,1861 +2,1819 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../DynamoDbEncryption/src/Index.dfy" - include "../../DynamoDbItemEncryptor/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkDynamoDbTypes - import AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype BatchExecuteStatementInputTransformInput = | BatchExecuteStatementInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementInputTransformOutput = | BatchExecuteStatementInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementOutputTransformInput = | BatchExecuteStatementOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput - ) - datatype BatchExecuteStatementOutputTransformOutput = | BatchExecuteStatementOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput - ) - datatype BatchGetItemInputTransformInput = | BatchGetItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemInputTransformOutput = | BatchGetItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemOutputTransformInput = | BatchGetItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchGetItemInput - ) - datatype BatchGetItemOutputTransformOutput = | BatchGetItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput - ) - datatype BatchWriteItemInputTransformInput = | BatchWriteItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemInputTransformOutput = | BatchWriteItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemOutputTransformInput = | BatchWriteItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput - ) - datatype BatchWriteItemOutputTransformOutput = | BatchWriteItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput - ) - datatype DeleteItemInputTransformInput = | DeleteItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemInputTransformOutput = | DeleteItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemOutputTransformInput = | DeleteItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.DeleteItemInput - ) - datatype DeleteItemOutputTransformOutput = | DeleteItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput - ) - class IDynamoDbEncryptionTransformsClientCallHistory { - ghost constructor() { - PutItemInputTransform := []; - PutItemOutputTransform := []; - GetItemInputTransform := []; - GetItemOutputTransform := []; - BatchWriteItemInputTransform := []; - BatchWriteItemOutputTransform := []; - BatchGetItemInputTransform := []; - BatchGetItemOutputTransform := []; - ScanInputTransform := []; - ScanOutputTransform := []; - QueryInputTransform := []; - QueryOutputTransform := []; - TransactWriteItemsInputTransform := []; - TransactWriteItemsOutputTransform := []; - UpdateItemInputTransform := []; - UpdateItemOutputTransform := []; - DeleteItemInputTransform := []; - DeleteItemOutputTransform := []; - TransactGetItemsInputTransform := []; - TransactGetItemsOutputTransform := []; - ExecuteStatementInputTransform := []; - ExecuteStatementOutputTransform := []; - BatchExecuteStatementInputTransform := []; - BatchExecuteStatementOutputTransform := []; - ExecuteTransactionInputTransform := []; - ExecuteTransactionOutputTransform := []; - ResolveAttributes := []; +include "../../DynamoDbEncryption/src/Index.dfy" +include "../../DynamoDbItemEncryptor/src/Index.dfy" +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkDynamoDbTypes + import AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) + + // Begin Generated Types + + datatype BatchExecuteStatementInputTransformInput = | BatchExecuteStatementInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementInputTransformOutput = | BatchExecuteStatementInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementOutputTransformInput = | BatchExecuteStatementOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchExecuteStatementInput + ) + datatype BatchExecuteStatementOutputTransformOutput = | BatchExecuteStatementOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput + ) + datatype BatchGetItemInputTransformInput = | BatchGetItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemInputTransformOutput = | BatchGetItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemOutputTransformInput = | BatchGetItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchGetItemInput + ) + datatype BatchGetItemOutputTransformOutput = | BatchGetItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchGetItemOutput + ) + datatype BatchWriteItemInputTransformInput = | BatchWriteItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemInputTransformOutput = | BatchWriteItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemOutputTransformInput = | BatchWriteItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.BatchWriteItemInput + ) + datatype BatchWriteItemOutputTransformOutput = | BatchWriteItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.BatchWriteItemOutput + ) + datatype DeleteItemInputTransformInput = | DeleteItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemInputTransformOutput = | DeleteItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemOutputTransformInput = | DeleteItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.DeleteItemInput + ) + datatype DeleteItemOutputTransformOutput = | DeleteItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.DeleteItemOutput + ) + class IDynamoDbEncryptionTransformsClientCallHistory { + ghost constructor() { + PutItemInputTransform := []; + PutItemOutputTransform := []; + GetItemInputTransform := []; + GetItemOutputTransform := []; + BatchWriteItemInputTransform := []; + BatchWriteItemOutputTransform := []; + BatchGetItemInputTransform := []; + BatchGetItemOutputTransform := []; + ScanInputTransform := []; + ScanOutputTransform := []; + QueryInputTransform := []; + QueryOutputTransform := []; + TransactWriteItemsInputTransform := []; + TransactWriteItemsOutputTransform := []; + UpdateItemInputTransform := []; + UpdateItemOutputTransform := []; + DeleteItemInputTransform := []; + DeleteItemOutputTransform := []; + TransactGetItemsInputTransform := []; + TransactGetItemsOutputTransform := []; + ExecuteStatementInputTransform := []; + ExecuteStatementOutputTransform := []; + BatchExecuteStatementInputTransform := []; + BatchExecuteStatementOutputTransform := []; + ExecuteTransactionInputTransform := []; + ExecuteTransactionOutputTransform := []; + ResolveAttributes := []; + } + ghost var PutItemInputTransform: seq>> + ghost var PutItemOutputTransform: seq>> + ghost var GetItemInputTransform: seq>> + ghost var GetItemOutputTransform: seq>> + ghost var BatchWriteItemInputTransform: seq>> + ghost var BatchWriteItemOutputTransform: seq>> + ghost var BatchGetItemInputTransform: seq>> + ghost var BatchGetItemOutputTransform: seq>> + ghost var ScanInputTransform: seq>> + ghost var ScanOutputTransform: seq>> + ghost var QueryInputTransform: seq>> + ghost var QueryOutputTransform: seq>> + ghost var TransactWriteItemsInputTransform: seq>> + ghost var TransactWriteItemsOutputTransform: seq>> + ghost var UpdateItemInputTransform: seq>> + ghost var UpdateItemOutputTransform: seq>> + ghost var DeleteItemInputTransform: seq>> + ghost var DeleteItemOutputTransform: seq>> + ghost var TransactGetItemsInputTransform: seq>> + ghost var TransactGetItemsOutputTransform: seq>> + ghost var ExecuteStatementInputTransform: seq>> + ghost var ExecuteStatementOutputTransform: seq>> + ghost var BatchExecuteStatementInputTransform: seq>> + ghost var BatchExecuteStatementOutputTransform: seq>> + ghost var ExecuteTransactionInputTransform: seq>> + ghost var ExecuteTransactionOutputTransform: seq>> + ghost var ResolveAttributes: seq>> + } + trait {:termination false} IDynamoDbEncryptionTransformsClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbEncryptionTransformsClientCallHistory + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method PutItemInputTransform ( input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemInputTransformEnsuresPublicly(input, output) + ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method PutItemOutputTransform ( input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemOutputTransformEnsuresPublicly(input, output) + ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method GetItemInputTransform ( input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemInputTransformEnsuresPublicly(input, output) + ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method GetItemOutputTransform ( input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemOutputTransformEnsuresPublicly(input, output) + ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + // The public method to be called by library consumers + method ScanInputTransform ( input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanInputTransformEnsuresPublicly(input, output) + ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] + + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ScanOutputTransform ( input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanOutputTransformEnsuresPublicly(input, output) + ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] + + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + // The public method to be called by library consumers + method QueryInputTransform ( input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryInputTransformEnsuresPublicly(input, output) + ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] + + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + // The public method to be called by library consumers + method QueryOutputTransform ( input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryOutputTransformEnsuresPublicly(input, output) + ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] + + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemInputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + // The public method to be called by library consumers + method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemInputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] + + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + // The public method to be called by library consumers + method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] + + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + // The public method to be called by library consumers + method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + // The public method to be called by library consumers + method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] + + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + // The public method to be called by library consumers + method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] + + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + // The public method to be called by library consumers + method ResolveAttributes ( input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ResolveAttributes + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ResolveAttributesEnsuresPublicly(input, output) + ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] + + } + datatype ExecuteStatementInputTransformInput = | ExecuteStatementInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementInputTransformOutput = | ExecuteStatementInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementOutputTransformInput = | ExecuteStatementOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput + ) + datatype ExecuteStatementOutputTransformOutput = | ExecuteStatementOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput + ) + datatype ExecuteTransactionInputTransformInput = | ExecuteTransactionInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionInputTransformOutput = | ExecuteTransactionInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionOutputTransformInput = | ExecuteTransactionOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput + ) + datatype ExecuteTransactionOutputTransformOutput = | ExecuteTransactionOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput + ) + datatype GetItemInputTransformInput = | GetItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemInputTransformOutput = | GetItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemOutputTransformInput = | GetItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.GetItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.GetItemInput + ) + datatype GetItemOutputTransformOutput = | GetItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.GetItemOutput + ) + datatype PutItemInputTransformInput = | PutItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemInputTransformOutput = | PutItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemOutputTransformInput = | PutItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.PutItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.PutItemInput + ) + datatype PutItemOutputTransformOutput = | PutItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.PutItemOutput + ) + datatype QueryInputTransformInput = | QueryInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryInputTransformOutput = | QueryInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryOutputTransformInput = | QueryOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.QueryOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.QueryInput + ) + datatype QueryOutputTransformOutput = | QueryOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.QueryOutput + ) + datatype ResolveAttributesInput = | ResolveAttributesInput ( + nameonly TableName: ComAmazonawsDynamodbTypes.TableName , + nameonly Item: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly Version: Option := Option.None + ) + datatype ResolveAttributesOutput = | ResolveAttributesOutput ( + nameonly VirtualFields: StringMap , + nameonly CompoundBeacons: StringMap + ) + datatype ScanInputTransformInput = | ScanInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanInputTransformOutput = | ScanInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanOutputTransformInput = | ScanOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.ScanOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.ScanInput + ) + datatype ScanOutputTransformOutput = | ScanOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.ScanOutput + ) + type StringMap = map + datatype TransactGetItemsInputTransformInput = | TransactGetItemsInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsInputTransformOutput = | TransactGetItemsInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsOutputTransformInput = | TransactGetItemsOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput + ) + datatype TransactGetItemsOutputTransformOutput = | TransactGetItemsOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput + ) + datatype TransactWriteItemsInputTransformInput = | TransactWriteItemsInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsInputTransformOutput = | TransactWriteItemsInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsOutputTransformInput = | TransactWriteItemsOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput + ) + datatype TransactWriteItemsOutputTransformOutput = | TransactWriteItemsOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput + ) + datatype UpdateItemInputTransformInput = | UpdateItemInputTransformInput ( + nameonly sdkInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemInputTransformOutput = | UpdateItemInputTransformOutput ( + nameonly transformedInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemOutputTransformInput = | UpdateItemOutputTransformInput ( + nameonly sdkOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput , + nameonly originalInput: ComAmazonawsDynamodbTypes.UpdateItemInput + ) + datatype UpdateItemOutputTransformOutput = | UpdateItemOutputTransformOutput ( + nameonly transformedOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput + ) + datatype Error = + // Local Error structures are listed here + | DynamoDbEncryptionTransformsException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) + | AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor(AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor: AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.Error) + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } - ghost var PutItemInputTransform: seq>> - ghost var PutItemOutputTransform: seq>> - ghost var GetItemInputTransform: seq>> - ghost var GetItemOutputTransform: seq>> - ghost var BatchWriteItemInputTransform: seq>> - ghost var BatchWriteItemOutputTransform: seq>> - ghost var BatchGetItemInputTransform: seq>> - ghost var BatchGetItemOutputTransform: seq>> - ghost var ScanInputTransform: seq>> - ghost var ScanOutputTransform: seq>> - ghost var QueryInputTransform: seq>> - ghost var QueryOutputTransform: seq>> - ghost var TransactWriteItemsInputTransform: seq>> - ghost var TransactWriteItemsOutputTransform: seq>> - ghost var UpdateItemInputTransform: seq>> - ghost var UpdateItemOutputTransform: seq>> - ghost var DeleteItemInputTransform: seq>> - ghost var DeleteItemOutputTransform: seq>> - ghost var TransactGetItemsInputTransform: seq>> - ghost var TransactGetItemsOutputTransform: seq>> - ghost var ExecuteStatementInputTransform: seq>> - ghost var ExecuteStatementOutputTransform: seq>> - ghost var BatchExecuteStatementInputTransform: seq>> - ghost var BatchExecuteStatementOutputTransform: seq>> - ghost var ExecuteTransactionInputTransform: seq>> - ghost var ExecuteTransactionOutputTransform: seq>> - ghost var ResolveAttributes: seq>> +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations + function method DefaultDynamoDbTablesEncryptionConfig(): AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig + method DynamoDbEncryptionTransforms(config: AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig := DefaultDynamoDbTablesEncryptionConfig()) + returns (res: Result) + requires var tmps0 := set t0 | t0 in config.tableEncryptionConfigs.Values; + forall tmp0 :: tmp0 in tmps0 ==> + tmp0.keyring.Some? ==> + tmp0.keyring.value.ValidState() + requires var tmps1 := set t1 | t1 in config.tableEncryptionConfigs.Values; + forall tmp1 :: tmp1 in tmps1 ==> + tmp1.cmm.Some? ==> + tmp1.cmm.value.ValidState() + requires var tmps2 := set t2 | t2 in config.tableEncryptionConfigs.Values; + forall tmp2 :: tmp2 in tmps2 ==> + tmp2.legacyOverride.Some? ==> + tmp2.legacyOverride.value.encryptor.ValidState() + requires var tmps3 := set t3 | t3 in config.tableEncryptionConfigs.Values; + forall tmp3 :: tmp3 in tmps3 ==> + tmp3.search.Some? ==> + var tmps4 := set t4 | t4 in tmp3.search.value.versions; + forall tmp4 :: tmp4 in tmps4 ==> + tmp4.keyStore.ValidState() + modifies set tmps5 <- set t5 <- config.tableEncryptionConfigs.Values | true + && t5.keyring.Some? + :: t5.keyring.value, + obj <- tmps5.Modifies | obj in tmps5.Modifies :: obj + modifies set tmps6 <- set t6 <- config.tableEncryptionConfigs.Values | true + && t6.cmm.Some? + :: t6.cmm.value, + obj <- tmps6.Modifies | obj in tmps6.Modifies :: obj + modifies set tmps7 <- set t7 <- config.tableEncryptionConfigs.Values | true + && t7.legacyOverride.Some? + :: t7.legacyOverride.value.encryptor, + obj <- tmps7.Modifies | obj in tmps7.Modifies :: obj + modifies set tmps8 <- set t8 <- config.tableEncryptionConfigs.Values | true + && t8.search.Some? + , t9 <- t8.search.value.versions :: t9.keyStore, + obj <- tmps8.Modifies | obj in tmps8.Modifies :: obj + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies + - ( set tmps10 <- set t10 <- config.tableEncryptionConfigs.Values | true + && t10.keyring.Some? + :: t10.keyring.value, + obj <- tmps10.Modifies | obj in tmps10.Modifies :: obj + ) - ( set tmps11 <- set t11 <- config.tableEncryptionConfigs.Values | true + && t11.cmm.Some? + :: t11.cmm.value, + obj <- tmps11.Modifies | obj in tmps11.Modifies :: obj + ) - ( set tmps12 <- set t12 <- config.tableEncryptionConfigs.Values | true + && t12.legacyOverride.Some? + :: t12.legacyOverride.value.encryptor, + obj <- tmps12.Modifies | obj in tmps12.Modifies :: obj + ) - ( set tmps13 <- set t13 <- config.tableEncryptionConfigs.Values | true + && t13.search.Some? + , t14 <- t13.search.value.versions :: t14.keyStore, + obj <- tmps13.Modifies | obj in tmps13.Modifies :: obj + ) ) + && fresh(res.value.History) + && res.value.ValidState() + ensures var tmps15 := set t15 | t15 in config.tableEncryptionConfigs.Values; + forall tmp15 :: tmp15 in tmps15 ==> + tmp15.keyring.Some? ==> + tmp15.keyring.value.ValidState() + ensures var tmps16 := set t16 | t16 in config.tableEncryptionConfigs.Values; + forall tmp16 :: tmp16 in tmps16 ==> + tmp16.cmm.Some? ==> + tmp16.cmm.value.ValidState() + ensures var tmps17 := set t17 | t17 in config.tableEncryptionConfigs.Values; + forall tmp17 :: tmp17 in tmps17 ==> + tmp17.legacyOverride.Some? ==> + tmp17.legacyOverride.value.encryptor.ValidState() + ensures var tmps18 := set t18 | t18 in config.tableEncryptionConfigs.Values; + forall tmp18 :: tmp18 in tmps18 ==> + tmp18.search.Some? ==> + var tmps19 := set t19 | t19 in tmp18.search.value.versions; + forall tmp19 :: tmp19 in tmps19 ==> + tmp19.keyStore.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbEncryptionTransformsClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbEncryptionTransformsClient extends IDynamoDbEncryptionTransformsClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + {Operations.PutItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method PutItemInputTransform ( input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemInputTransformEnsuresPublicly(input, output) + ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.PutItemInputTransform(config, input); + History.PutItemInputTransform := History.PutItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + {Operations.PutItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method PutItemOutputTransform ( input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemOutputTransformEnsuresPublicly(input, output) + ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.PutItemOutputTransform(config, input); + History.PutItemOutputTransform := History.PutItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + {Operations.GetItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method GetItemInputTransform ( input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemInputTransformEnsuresPublicly(input, output) + ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.GetItemInputTransform(config, input); + History.GetItemInputTransform := History.GetItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + {Operations.GetItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method GetItemOutputTransform ( input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemOutputTransformEnsuresPublicly(input, output) + ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.GetItemOutputTransform(config, input); + History.GetItemOutputTransform := History.GetItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + {Operations.BatchWriteItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchWriteItemInputTransform(config, input); + History.BatchWriteItemInputTransform := History.BatchWriteItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + {Operations.BatchWriteItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchWriteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchWriteItemOutputTransform(config, input); + History.BatchWriteItemOutputTransform := History.BatchWriteItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + {Operations.BatchGetItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchGetItemInputTransform(config, input); + History.BatchGetItemInputTransform := History.BatchGetItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + {Operations.BatchGetItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchGetItemOutputTransform(config, input); + History.BatchGetItemOutputTransform := History.BatchGetItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + {Operations.ScanInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ScanInputTransform ( input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanInputTransformEnsuresPublicly(input, output) + ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ScanInputTransform(config, input); + History.ScanInputTransform := History.ScanInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + {Operations.ScanOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ScanOutputTransform ( input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ScanOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanOutputTransformEnsuresPublicly(input, output) + ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ScanOutputTransform(config, input); + History.ScanOutputTransform := History.ScanOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + {Operations.QueryInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method QueryInputTransform ( input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryInputTransformEnsuresPublicly(input, output) + ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.QueryInputTransform(config, input); + History.QueryInputTransform := History.QueryInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + {Operations.QueryOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method QueryOutputTransform ( input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`QueryOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryOutputTransformEnsuresPublicly(input, output) + ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.QueryOutputTransform(config, input); + History.QueryOutputTransform := History.QueryOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + {Operations.TransactWriteItemsInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactWriteItemsInputTransform(config, input); + History.TransactWriteItemsInputTransform := History.TransactWriteItemsInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + {Operations.TransactWriteItemsOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactWriteItemsOutputTransform(config, input); + History.TransactWriteItemsOutputTransform := History.TransactWriteItemsOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + {Operations.UpdateItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemInputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.UpdateItemInputTransform(config, input); + History.UpdateItemInputTransform := History.UpdateItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + {Operations.UpdateItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.UpdateItemOutputTransform(config, input); + History.UpdateItemOutputTransform := History.UpdateItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + {Operations.DeleteItemInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemInputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.DeleteItemInputTransform(config, input); + History.DeleteItemInputTransform := History.DeleteItemInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + {Operations.DeleteItemOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItemOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.DeleteItemOutputTransform(config, input); + History.DeleteItemOutputTransform := History.DeleteItemOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + {Operations.TransactGetItemsInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactGetItemsInputTransform(config, input); + History.TransactGetItemsInputTransform := History.TransactGetItemsInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + {Operations.TransactGetItemsOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactGetItemsOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.TransactGetItemsOutputTransform(config, input); + History.TransactGetItemsOutputTransform := History.TransactGetItemsOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + {Operations.ExecuteStatementInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteStatementInputTransform(config, input); + History.ExecuteStatementInputTransform := History.ExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + {Operations.ExecuteStatementOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteStatementOutputTransform(config, input); + History.ExecuteStatementOutputTransform := History.ExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + {Operations.BatchExecuteStatementInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchExecuteStatementInputTransform(config, input); + History.BatchExecuteStatementInputTransform := History.BatchExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + {Operations.BatchExecuteStatementOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchExecuteStatementOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.BatchExecuteStatementOutputTransform(config, input); + History.BatchExecuteStatementOutputTransform := History.BatchExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + {Operations.ExecuteTransactionInputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionInputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteTransactionInputTransform(config, input); + History.ExecuteTransactionInputTransform := History.ExecuteTransactionInputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + {Operations.ExecuteTransactionOutputTransformEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ExecuteTransactionOutputTransform + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] + { + output := Operations.ExecuteTransactionOutputTransform(config, input); + History.ExecuteTransactionOutputTransform := History.ExecuteTransactionOutputTransform + [DafnyCallEvent(input, output)]; + } + + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + {Operations.ResolveAttributesEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method ResolveAttributes ( input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`ResolveAttributes + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ResolveAttributesEnsuresPublicly(input, output) + ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] + { + output := Operations.ResolveAttributes(config, input); + History.ResolveAttributes := History.ResolveAttributes + [DafnyCallEvent(input, output)]; + } + + } } - trait {:termination false} IDynamoDbEncryptionTransformsClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; - - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbEncryptionTransformsClientCallHistory - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method PutItemInputTransform ( input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemInputTransformEnsuresPublicly(input, output) - ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method PutItemOutputTransform ( input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemOutputTransformEnsuresPublicly(input, output) - ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method GetItemInputTransform ( input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemInputTransformEnsuresPublicly(input, output) - ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method GetItemOutputTransform ( input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemOutputTransformEnsuresPublicly(input, output) - ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - // The public method to be called by library consumers - method ScanInputTransform ( input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanInputTransformEnsuresPublicly(input, output) - ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] - - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ScanOutputTransform ( input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanOutputTransformEnsuresPublicly(input, output) - ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] - - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - // The public method to be called by library consumers - method QueryInputTransform ( input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryInputTransformEnsuresPublicly(input, output) - ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] - - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - // The public method to be called by library consumers - method QueryOutputTransform ( input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryOutputTransformEnsuresPublicly(input, output) - ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] - - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemInputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - // The public method to be called by library consumers - method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemInputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] - - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - // The public method to be called by library consumers - method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] - - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - // The public method to be called by library consumers - method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - // The public method to be called by library consumers - method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] - - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - // The public method to be called by library consumers - method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] - - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - // The public method to be called by library consumers - method ResolveAttributes ( input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ResolveAttributes - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ResolveAttributesEnsuresPublicly(input, output) - ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] - -} - datatype ExecuteStatementInputTransformInput = | ExecuteStatementInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementInputTransformOutput = | ExecuteStatementInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementOutputTransformInput = | ExecuteStatementOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteStatementInput - ) - datatype ExecuteStatementOutputTransformOutput = | ExecuteStatementOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteStatementOutput - ) - datatype ExecuteTransactionInputTransformInput = | ExecuteTransactionInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionInputTransformOutput = | ExecuteTransactionInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionOutputTransformInput = | ExecuteTransactionOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ExecuteTransactionInput - ) - datatype ExecuteTransactionOutputTransformOutput = | ExecuteTransactionOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ExecuteTransactionOutput - ) - datatype GetItemInputTransformInput = | GetItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemInputTransformOutput = | GetItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemOutputTransformInput = | GetItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.GetItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.GetItemInput - ) - datatype GetItemOutputTransformOutput = | GetItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.GetItemOutput - ) - datatype PutItemInputTransformInput = | PutItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemInputTransformOutput = | PutItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemOutputTransformInput = | PutItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.PutItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.PutItemInput - ) - datatype PutItemOutputTransformOutput = | PutItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.PutItemOutput - ) - datatype QueryInputTransformInput = | QueryInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryInputTransformOutput = | QueryInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryOutputTransformInput = | QueryOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.QueryOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.QueryInput - ) - datatype QueryOutputTransformOutput = | QueryOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.QueryOutput - ) - datatype ResolveAttributesInput = | ResolveAttributesInput ( - nameonly TableName: ComAmazonawsDynamodbTypes.TableName , - nameonly Item: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly Version: Option := Option.None - ) - datatype ResolveAttributesOutput = | ResolveAttributesOutput ( - nameonly VirtualFields: StringMap , - nameonly CompoundBeacons: StringMap - ) - datatype ScanInputTransformInput = | ScanInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanInputTransformOutput = | ScanInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanOutputTransformInput = | ScanOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.ScanOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.ScanInput - ) - datatype ScanOutputTransformOutput = | ScanOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.ScanOutput - ) - type StringMap = map - datatype TransactGetItemsInputTransformInput = | TransactGetItemsInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsInputTransformOutput = | TransactGetItemsInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsOutputTransformInput = | TransactGetItemsOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.TransactGetItemsInput - ) - datatype TransactGetItemsOutputTransformOutput = | TransactGetItemsOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactGetItemsOutput - ) - datatype TransactWriteItemsInputTransformInput = | TransactWriteItemsInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsInputTransformOutput = | TransactWriteItemsInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsOutputTransformInput = | TransactWriteItemsOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.TransactWriteItemsInput - ) - datatype TransactWriteItemsOutputTransformOutput = | TransactWriteItemsOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.TransactWriteItemsOutput - ) - datatype UpdateItemInputTransformInput = | UpdateItemInputTransformInput ( - nameonly sdkInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemInputTransformOutput = | UpdateItemInputTransformOutput ( - nameonly transformedInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemOutputTransformInput = | UpdateItemOutputTransformInput ( - nameonly sdkOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput , - nameonly originalInput: ComAmazonawsDynamodbTypes.UpdateItemInput - ) - datatype UpdateItemOutputTransformOutput = | UpdateItemOutputTransformOutput ( - nameonly transformedOutput: ComAmazonawsDynamodbTypes.UpdateItemOutput - ) - datatype Error = - // Local Error structures are listed here - | DynamoDbEncryptionTransformsException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) - | AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor(AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor: AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.Error) - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations - function method DefaultDynamoDbTablesEncryptionConfig(): AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig - method DynamoDbEncryptionTransforms(config: AwsCryptographyDbEncryptionSdkDynamoDbTypes.DynamoDbTablesEncryptionConfig := DefaultDynamoDbTablesEncryptionConfig()) - returns (res: Result) -// BEGIN MANUAL EDIT - requires var tmps0 := set t0 | t0 in config.tableEncryptionConfigs.Values; - forall tmp0 :: tmp0 in tmps0 ==> - tmp0.keyring.Some? ==> - tmp0.keyring.value.ValidState() - requires var tmps1 := set t1 | t1 in config.tableEncryptionConfigs.Values; - forall tmp1 :: tmp1 in tmps1 ==> - tmp1.cmm.Some? ==> - tmp1.cmm.value.ValidState() - requires var tmps2 := set t2 | t2 in config.tableEncryptionConfigs.Values; - forall tmp2 :: tmp2 in tmps2 ==> - tmp2.legacyOverride.Some? ==> - tmp2.legacyOverride.value.encryptor.ValidState() - requires var tmps3 := set t3 | t3 in config.tableEncryptionConfigs.Values; - forall tmp3 :: tmp3 in tmps3 ==> - tmp3.search.Some? ==> - var tmps4 := set t4 | t4 in tmp3.search.value.versions; - forall tmp4 :: tmp4 in tmps4 ==> - tmp4.keyStore.ValidState() - modifies var tmps5 := set t5 | t5 in config.tableEncryptionConfigs.Values - && t5.keyring.Some? - :: t5.keyring.value; - var tmps5FlattenedModifiesSet: set> := set t0 - | t0 in tmps5 :: t0.Modifies; - (set tmp6ModifyEntry, tmp6Modifies | - tmp6Modifies in tmps5FlattenedModifiesSet - && tmp6ModifyEntry in tmp6Modifies - :: tmp6ModifyEntry) - modifies var tmps7 := set t7 | t7 in config.tableEncryptionConfigs.Values - && t7.cmm.Some? - :: t7.cmm.value; - var tmps7FlattenedModifiesSet: set> := set t0 - | t0 in tmps7 :: t0.Modifies; - (set tmp8ModifyEntry, tmp8Modifies | - tmp8Modifies in tmps7FlattenedModifiesSet - && tmp8ModifyEntry in tmp8Modifies - :: tmp8ModifyEntry) - modifies var tmps9 := set t9 | t9 in config.tableEncryptionConfigs.Values - && t9.legacyOverride.Some? - :: t9.legacyOverride.value.encryptor; - var tmps9FlattenedModifiesSet: set> := set t0 - | t0 in tmps9 :: t0.Modifies; - (set tmp10ModifyEntry, tmp10Modifies | - tmp10Modifies in tmps9FlattenedModifiesSet - && tmp10ModifyEntry in tmp10Modifies - :: tmp10ModifyEntry) - modifies var tmps11 := set t11 | t11 in config.tableEncryptionConfigs.Values - && t11.search.Some? - :: set t12 | t12 in t11.search.value.versions :: t12.keyStore; - var tmps11FlattenedModifiesSet: set> := set t0 -, t1 | t0 in tmps11 && t1 in t0 :: t1.Modifies; - (set tmp13ModifyEntry, tmp13Modifies | - tmp13Modifies in tmps11FlattenedModifiesSet - && tmp13ModifyEntry in tmp13Modifies - :: tmp13ModifyEntry) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies - - ( var tmps14 := set t14 | t14 in config.tableEncryptionConfigs.Values - && t14.keyring.Some? - :: t14.keyring.value; - var tmps14FlattenedModifiesSet: set> := set t0 - | t0 in tmps14 :: t0.Modifies; - (set tmp15ModifyEntry, tmp15Modifies | - tmp15Modifies in tmps14FlattenedModifiesSet - && tmp15ModifyEntry in tmp15Modifies - :: tmp15ModifyEntry) - ) - ( var tmps16 := set t16 | t16 in config.tableEncryptionConfigs.Values - && t16.cmm.Some? - :: t16.cmm.value; - var tmps16FlattenedModifiesSet: set> := set t0 - | t0 in tmps16 :: t0.Modifies; - (set tmp17ModifyEntry, tmp17Modifies | - tmp17Modifies in tmps16FlattenedModifiesSet - && tmp17ModifyEntry in tmp17Modifies - :: tmp17ModifyEntry) - ) - ( var tmps18 := set t18 | t18 in config.tableEncryptionConfigs.Values - && t18.legacyOverride.Some? - :: t18.legacyOverride.value.encryptor; - var tmps18FlattenedModifiesSet: set> := set t0 - | t0 in tmps18 :: t0.Modifies; - (set tmp19ModifyEntry, tmp19Modifies | - tmp19Modifies in tmps18FlattenedModifiesSet - && tmp19ModifyEntry in tmp19Modifies - :: tmp19ModifyEntry) - ) - ( var tmps20 := set t20 | t20 in config.tableEncryptionConfigs.Values - && t20.search.Some? - :: set t21 | t21 in t20.search.value.versions :: t21.keyStore; - var tmps20FlattenedModifiesSet: set> := set t0 -, t1 | t0 in tmps20 && t1 in t0 :: t1.Modifies; - (set tmp22ModifyEntry, tmp22Modifies | - tmp22Modifies in tmps20FlattenedModifiesSet - && tmp22ModifyEntry in tmp22Modifies - :: tmp22ModifyEntry) - ) ) - && fresh(res.value.History) - && res.value.ValidState() - ensures var tmps23 := set t23 | t23 in config.tableEncryptionConfigs.Values; - forall tmp23 :: tmp23 in tmps23 ==> - tmp23.keyring.Some? ==> - tmp23.keyring.value.ValidState() - ensures var tmps24 := set t24 | t24 in config.tableEncryptionConfigs.Values; - forall tmp24 :: tmp24 in tmps24 ==> - tmp24.cmm.Some? ==> - tmp24.cmm.value.ValidState() - ensures var tmps25 := set t25 | t25 in config.tableEncryptionConfigs.Values; - forall tmp25 :: tmp25 in tmps25 ==> - tmp25.legacyOverride.Some? ==> - tmp25.legacyOverride.value.encryptor.ValidState() - ensures var tmps26 := set t26 | t26 in config.tableEncryptionConfigs.Values; - forall tmp26 :: tmp26 in tmps26 ==> - tmp26.search.Some? ==> - var tmps27 := set t27 | t27 in tmp26.search.value.versions; - forall tmp27 :: tmp27 in tmps27 ==> - tmp27.keyStore.ValidState() -// END MANUAL EDIT - - // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals - function method CreateSuccessOfClient(client: IDynamoDbEncryptionTransformsClient): Result { - Success(client) - } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals - function method CreateFailureOfError(error: Error): Result { - Failure(error) - } - class DynamoDbEncryptionTransformsClient extends IDynamoDbEncryptionTransformsClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - {Operations.PutItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method PutItemInputTransform ( input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemInputTransformEnsuresPublicly(input, output) - ensures History.PutItemInputTransform == old(History.PutItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.PutItemInputTransform(config, input); - History.PutItemInputTransform := History.PutItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - {Operations.PutItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method PutItemOutputTransform ( input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`PutItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures PutItemOutputTransformEnsuresPublicly(input, output) - ensures History.PutItemOutputTransform == old(History.PutItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.PutItemOutputTransform(config, input); - History.PutItemOutputTransform := History.PutItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - {Operations.GetItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method GetItemInputTransform ( input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemInputTransformEnsuresPublicly(input, output) - ensures History.GetItemInputTransform == old(History.GetItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.GetItemInputTransform(config, input); - History.GetItemInputTransform := History.GetItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - {Operations.GetItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method GetItemOutputTransform ( input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`GetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures GetItemOutputTransformEnsuresPublicly(input, output) - ensures History.GetItemOutputTransform == old(History.GetItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.GetItemOutputTransform(config, input); - History.GetItemOutputTransform := History.GetItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - {Operations.BatchWriteItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchWriteItemInputTransform ( input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemInputTransform == old(History.BatchWriteItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchWriteItemInputTransform(config, input); - History.BatchWriteItemInputTransform := History.BatchWriteItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - {Operations.BatchWriteItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchWriteItemOutputTransform ( input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchWriteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchWriteItemOutputTransform == old(History.BatchWriteItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchWriteItemOutputTransform(config, input); - History.BatchWriteItemOutputTransform := History.BatchWriteItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - {Operations.BatchGetItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchGetItemInputTransform ( input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemInputTransform == old(History.BatchGetItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchGetItemInputTransform(config, input); - History.BatchGetItemInputTransform := History.BatchGetItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - {Operations.BatchGetItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchGetItemOutputTransform ( input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchGetItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - ensures History.BatchGetItemOutputTransform == old(History.BatchGetItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchGetItemOutputTransform(config, input); - History.BatchGetItemOutputTransform := History.BatchGetItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - {Operations.ScanInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ScanInputTransform ( input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanInputTransformEnsuresPublicly(input, output) - ensures History.ScanInputTransform == old(History.ScanInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ScanInputTransform(config, input); - History.ScanInputTransform := History.ScanInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - {Operations.ScanOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ScanOutputTransform ( input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ScanOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ScanOutputTransformEnsuresPublicly(input, output) - ensures History.ScanOutputTransform == old(History.ScanOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ScanOutputTransform(config, input); - History.ScanOutputTransform := History.ScanOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - {Operations.QueryInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method QueryInputTransform ( input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryInputTransformEnsuresPublicly(input, output) - ensures History.QueryInputTransform == old(History.QueryInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.QueryInputTransform(config, input); - History.QueryInputTransform := History.QueryInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - {Operations.QueryOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method QueryOutputTransform ( input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`QueryOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures QueryOutputTransformEnsuresPublicly(input, output) - ensures History.QueryOutputTransform == old(History.QueryOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.QueryOutputTransform(config, input); - History.QueryOutputTransform := History.QueryOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - {Operations.TransactWriteItemsInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactWriteItemsInputTransform ( input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsInputTransform == old(History.TransactWriteItemsInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactWriteItemsInputTransform(config, input); - History.TransactWriteItemsInputTransform := History.TransactWriteItemsInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - {Operations.TransactWriteItemsOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactWriteItemsOutputTransform ( input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactWriteItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactWriteItemsOutputTransform == old(History.TransactWriteItemsOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactWriteItemsOutputTransform(config, input); - History.TransactWriteItemsOutputTransform := History.TransactWriteItemsOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - {Operations.UpdateItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method UpdateItemInputTransform ( input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemInputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemInputTransform == old(History.UpdateItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.UpdateItemInputTransform(config, input); - History.UpdateItemInputTransform := History.UpdateItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - {Operations.UpdateItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method UpdateItemOutputTransform ( input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`UpdateItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - ensures History.UpdateItemOutputTransform == old(History.UpdateItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.UpdateItemOutputTransform(config, input); - History.UpdateItemOutputTransform := History.UpdateItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - {Operations.DeleteItemInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DeleteItemInputTransform ( input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemInputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemInputTransform == old(History.DeleteItemInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.DeleteItemInputTransform(config, input); - History.DeleteItemInputTransform := History.DeleteItemInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - {Operations.DeleteItemOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DeleteItemOutputTransform ( input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DeleteItemOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - ensures History.DeleteItemOutputTransform == old(History.DeleteItemOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.DeleteItemOutputTransform(config, input); - History.DeleteItemOutputTransform := History.DeleteItemOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - {Operations.TransactGetItemsInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactGetItemsInputTransform ( input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsInputTransform == old(History.TransactGetItemsInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactGetItemsInputTransform(config, input); - History.TransactGetItemsInputTransform := History.TransactGetItemsInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - {Operations.TransactGetItemsOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method TransactGetItemsOutputTransform ( input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`TransactGetItemsOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - ensures History.TransactGetItemsOutputTransform == old(History.TransactGetItemsOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.TransactGetItemsOutputTransform(config, input); - History.TransactGetItemsOutputTransform := History.TransactGetItemsOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - {Operations.ExecuteStatementInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteStatementInputTransform ( input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementInputTransform == old(History.ExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteStatementInputTransform(config, input); - History.ExecuteStatementInputTransform := History.ExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - {Operations.ExecuteStatementOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteStatementOutputTransform ( input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteStatementOutputTransform == old(History.ExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteStatementOutputTransform(config, input); - History.ExecuteStatementOutputTransform := History.ExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - {Operations.BatchExecuteStatementInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchExecuteStatementInputTransform ( input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementInputTransform == old(History.BatchExecuteStatementInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchExecuteStatementInputTransform(config, input); - History.BatchExecuteStatementInputTransform := History.BatchExecuteStatementInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - {Operations.BatchExecuteStatementOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method BatchExecuteStatementOutputTransform ( input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`BatchExecuteStatementOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - ensures History.BatchExecuteStatementOutputTransform == old(History.BatchExecuteStatementOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.BatchExecuteStatementOutputTransform(config, input); - History.BatchExecuteStatementOutputTransform := History.BatchExecuteStatementOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - {Operations.ExecuteTransactionInputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteTransactionInputTransform ( input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionInputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionInputTransform == old(History.ExecuteTransactionInputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteTransactionInputTransform(config, input); - History.ExecuteTransactionInputTransform := History.ExecuteTransactionInputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - {Operations.ExecuteTransactionOutputTransformEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ExecuteTransactionOutputTransform ( input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ExecuteTransactionOutputTransform - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - ensures History.ExecuteTransactionOutputTransform == old(History.ExecuteTransactionOutputTransform) + [DafnyCallEvent(input, output)] - { - output := Operations.ExecuteTransactionOutputTransform(config, input); - History.ExecuteTransactionOutputTransform := History.ExecuteTransactionOutputTransform + [DafnyCallEvent(input, output)]; -} - - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - {Operations.ResolveAttributesEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method ResolveAttributes ( input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`ResolveAttributes - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures ResolveAttributesEnsuresPublicly(input, output) - ensures History.ResolveAttributes == old(History.ResolveAttributes) + [DafnyCallEvent(input, output)] - { - output := Operations.ResolveAttributes(config, input); - History.ResolveAttributes := History.ResolveAttributes + [DafnyCallEvent(input, output)]; -} - -} -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method PutItemInputTransform ( config: InternalConfig , input: PutItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures PutItemInputTransformEnsuresPublicly(input, output) - - - predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method PutItemOutputTransform ( config: InternalConfig , input: PutItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures PutItemOutputTransformEnsuresPublicly(input, output) - - - predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method GetItemInputTransform ( config: InternalConfig , input: GetItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures GetItemInputTransformEnsuresPublicly(input, output) - - - predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method GetItemOutputTransform ( config: InternalConfig , input: GetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures GetItemOutputTransformEnsuresPublicly(input, output) - - - predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method BatchWriteItemInputTransform ( config: InternalConfig , input: BatchWriteItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) - - - predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer - - - method BatchWriteItemOutputTransform ( config: InternalConfig , input: BatchWriteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) - +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbTransformsOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate PutItemInputTransformEnsuresPublicly(input: PutItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method PutItemInputTransform ( config: InternalConfig , input: PutItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures PutItemInputTransformEnsuresPublicly(input, output) + + + predicate PutItemOutputTransformEnsuresPublicly(input: PutItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method PutItemOutputTransform ( config: InternalConfig , input: PutItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures PutItemOutputTransformEnsuresPublicly(input, output) + + + predicate GetItemInputTransformEnsuresPublicly(input: GetItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method GetItemInputTransform ( config: InternalConfig , input: GetItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures GetItemInputTransformEnsuresPublicly(input, output) + + + predicate GetItemOutputTransformEnsuresPublicly(input: GetItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method GetItemOutputTransform ( config: InternalConfig , input: GetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures GetItemOutputTransformEnsuresPublicly(input, output) + + + predicate BatchWriteItemInputTransformEnsuresPublicly(input: BatchWriteItemInputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method BatchWriteItemInputTransform ( config: InternalConfig , input: BatchWriteItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchWriteItemInputTransformEnsuresPublicly(input, output) + + + predicate BatchWriteItemOutputTransformEnsuresPublicly(input: BatchWriteItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer + + + method BatchWriteItemOutputTransform ( config: InternalConfig , input: BatchWriteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchWriteItemOutputTransformEnsuresPublicly(input, output) + - predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchGetItemInputTransformEnsuresPublicly(input: BatchGetItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchGetItemInputTransform ( config: InternalConfig , input: BatchGetItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchGetItemInputTransformEnsuresPublicly(input, output) + method BatchGetItemInputTransform ( config: InternalConfig , input: BatchGetItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchGetItemInputTransformEnsuresPublicly(input, output) - predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchGetItemOutputTransformEnsuresPublicly(input: BatchGetItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchGetItemOutputTransform ( config: InternalConfig , input: BatchGetItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) + method BatchGetItemOutputTransform ( config: InternalConfig , input: BatchGetItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchGetItemOutputTransformEnsuresPublicly(input, output) - predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ScanInputTransformEnsuresPublicly(input: ScanInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ScanInputTransform ( config: InternalConfig , input: ScanInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ScanInputTransformEnsuresPublicly(input, output) + method ScanInputTransform ( config: InternalConfig , input: ScanInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ScanInputTransformEnsuresPublicly(input, output) - predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ScanOutputTransformEnsuresPublicly(input: ScanOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ScanOutputTransform ( config: InternalConfig , input: ScanOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ScanOutputTransformEnsuresPublicly(input, output) + method ScanOutputTransform ( config: InternalConfig , input: ScanOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ScanOutputTransformEnsuresPublicly(input, output) - predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate QueryInputTransformEnsuresPublicly(input: QueryInputTransformInput , output: Result) + // The private method to be refined by the library developer - method QueryInputTransform ( config: InternalConfig , input: QueryInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures QueryInputTransformEnsuresPublicly(input, output) + method QueryInputTransform ( config: InternalConfig , input: QueryInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures QueryInputTransformEnsuresPublicly(input, output) - predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate QueryOutputTransformEnsuresPublicly(input: QueryOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method QueryOutputTransform ( config: InternalConfig , input: QueryOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures QueryOutputTransformEnsuresPublicly(input, output) + method QueryOutputTransform ( config: InternalConfig , input: QueryOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures QueryOutputTransformEnsuresPublicly(input, output) - predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactWriteItemsInputTransformEnsuresPublicly(input: TransactWriteItemsInputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactWriteItemsInputTransform ( config: InternalConfig , input: TransactWriteItemsInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) + method TransactWriteItemsInputTransform ( config: InternalConfig , input: TransactWriteItemsInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactWriteItemsInputTransformEnsuresPublicly(input, output) - predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactWriteItemsOutputTransformEnsuresPublicly(input: TransactWriteItemsOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactWriteItemsOutputTransform ( config: InternalConfig , input: TransactWriteItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) + method TransactWriteItemsOutputTransform ( config: InternalConfig , input: TransactWriteItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactWriteItemsOutputTransformEnsuresPublicly(input, output) - predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate UpdateItemInputTransformEnsuresPublicly(input: UpdateItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method UpdateItemInputTransform ( config: InternalConfig , input: UpdateItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures UpdateItemInputTransformEnsuresPublicly(input, output) + method UpdateItemInputTransform ( config: InternalConfig , input: UpdateItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures UpdateItemInputTransformEnsuresPublicly(input, output) - predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate UpdateItemOutputTransformEnsuresPublicly(input: UpdateItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method UpdateItemOutputTransform ( config: InternalConfig , input: UpdateItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures UpdateItemOutputTransformEnsuresPublicly(input, output) + method UpdateItemOutputTransform ( config: InternalConfig , input: UpdateItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures UpdateItemOutputTransformEnsuresPublicly(input, output) - predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate DeleteItemInputTransformEnsuresPublicly(input: DeleteItemInputTransformInput , output: Result) + // The private method to be refined by the library developer - method DeleteItemInputTransform ( config: InternalConfig , input: DeleteItemInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DeleteItemInputTransformEnsuresPublicly(input, output) + method DeleteItemInputTransform ( config: InternalConfig , input: DeleteItemInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DeleteItemInputTransformEnsuresPublicly(input, output) - predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate DeleteItemOutputTransformEnsuresPublicly(input: DeleteItemOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method DeleteItemOutputTransform ( config: InternalConfig , input: DeleteItemOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DeleteItemOutputTransformEnsuresPublicly(input, output) + method DeleteItemOutputTransform ( config: InternalConfig , input: DeleteItemOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DeleteItemOutputTransformEnsuresPublicly(input, output) - predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactGetItemsInputTransformEnsuresPublicly(input: TransactGetItemsInputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactGetItemsInputTransform ( config: InternalConfig , input: TransactGetItemsInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) + method TransactGetItemsInputTransform ( config: InternalConfig , input: TransactGetItemsInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactGetItemsInputTransformEnsuresPublicly(input, output) - predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate TransactGetItemsOutputTransformEnsuresPublicly(input: TransactGetItemsOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method TransactGetItemsOutputTransform ( config: InternalConfig , input: TransactGetItemsOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) + method TransactGetItemsOutputTransform ( config: InternalConfig , input: TransactGetItemsOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures TransactGetItemsOutputTransformEnsuresPublicly(input, output) - predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteStatementInputTransformEnsuresPublicly(input: ExecuteStatementInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteStatementInputTransform ( config: InternalConfig , input: ExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) - + method ExecuteStatementInputTransform ( config: InternalConfig , input: ExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteStatementInputTransformEnsuresPublicly(input, output) + - predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteStatementOutputTransformEnsuresPublicly(input: ExecuteStatementOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteStatementOutputTransform ( config: InternalConfig , input: ExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) - + method ExecuteStatementOutputTransform ( config: InternalConfig , input: ExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteStatementOutputTransformEnsuresPublicly(input, output) + - predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchExecuteStatementInputTransformEnsuresPublicly(input: BatchExecuteStatementInputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchExecuteStatementInputTransform ( config: InternalConfig , input: BatchExecuteStatementInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) - + method BatchExecuteStatementInputTransform ( config: InternalConfig , input: BatchExecuteStatementInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchExecuteStatementInputTransformEnsuresPublicly(input, output) + - predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate BatchExecuteStatementOutputTransformEnsuresPublicly(input: BatchExecuteStatementOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method BatchExecuteStatementOutputTransform ( config: InternalConfig , input: BatchExecuteStatementOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) - + method BatchExecuteStatementOutputTransform ( config: InternalConfig , input: BatchExecuteStatementOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures BatchExecuteStatementOutputTransformEnsuresPublicly(input, output) + - predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteTransactionInputTransformEnsuresPublicly(input: ExecuteTransactionInputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteTransactionInputTransform ( config: InternalConfig , input: ExecuteTransactionInputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) - + method ExecuteTransactionInputTransform ( config: InternalConfig , input: ExecuteTransactionInputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteTransactionInputTransformEnsuresPublicly(input, output) + - predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) - // The private method to be refined by the library developer + predicate ExecuteTransactionOutputTransformEnsuresPublicly(input: ExecuteTransactionOutputTransformInput , output: Result) + // The private method to be refined by the library developer - method ExecuteTransactionOutputTransform ( config: InternalConfig , input: ExecuteTransactionOutputTransformInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) - + method ExecuteTransactionOutputTransform ( config: InternalConfig , input: ExecuteTransactionOutputTransformInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ExecuteTransactionOutputTransformEnsuresPublicly(input, output) + - predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) - // The private method to be refined by the library developer + predicate ResolveAttributesEnsuresPublicly(input: ResolveAttributesInput , output: Result) + // The private method to be refined by the library developer - method ResolveAttributes ( config: InternalConfig , input: ResolveAttributesInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures ResolveAttributesEnsuresPublicly(input, output) + method ResolveAttributes ( config: InternalConfig , input: ResolveAttributesInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures ResolveAttributesEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy index f51ac0792..7e57a65e5 100644 --- a/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy @@ -2,312 +2,312 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../DynamoDbEncryption/src/Index.dfy" - include "../../StructuredEncryption/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyDbEncryptionSdkDynamoDbTypes - import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyPrimitivesTypes - import ComAmazonawsDynamodbTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype DecryptItemInput = | DecryptItemInput ( - nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap - ) - datatype DecryptItemOutput = | DecryptItemOutput ( - nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly parsedHeader: Option := Option.None - ) - class IDynamoDbItemEncryptorClientCallHistory { - ghost constructor() { - EncryptItem := []; - DecryptItem := []; -} - ghost var EncryptItem: seq>> - ghost var DecryptItem: seq>> -} - trait {:termination false} IDynamoDbItemEncryptorClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../DynamoDbEncryption/src/Index.dfy" +include "../../StructuredEncryption/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +include "../../../../submodules/MaterialProviders/ComAmazonawsDynamodb/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types" } AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyDbEncryptionSdkDynamoDbTypes + import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyPrimitivesTypes + import ComAmazonawsDynamodbTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IDynamoDbItemEncryptorClientCallHistory - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - // The public method to be called by library consumers - method EncryptItem ( input: EncryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`EncryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures EncryptItemEnsuresPublicly(input, output) - ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] - - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - // The public method to be called by library consumers - method DecryptItem ( input: DecryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DecryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DecryptItemEnsuresPublicly(input, output) - ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] - -} - datatype DynamoDbItemEncryptorConfig = | DynamoDbItemEncryptorConfig ( - nameonly logicalTableName: string , - nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , - nameonly sortKeyName: Option := Option.None , - nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , - nameonly allowedUnsignedAttributes: Option := Option.None , - nameonly allowedUnsignedAttributePrefix: Option := Option.None , - nameonly algorithmSuiteId: Option := Option.None , - nameonly keyring: Option := Option.None , - nameonly cmm: Option := Option.None , - nameonly legacyOverride: Option := Option.None , - nameonly plaintextOverride: Option := Option.None - ) - datatype EncryptItemInput = | EncryptItemInput ( - nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap - ) - datatype EncryptItemOutput = | EncryptItemOutput ( - nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap , - nameonly parsedHeader: Option := Option.None - ) - datatype ParsedHeader = | ParsedHeader ( - nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , - nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , - nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , - nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , - nameonly encryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , - nameonly selectorContext: ComAmazonawsDynamodbTypes.Key - ) - datatype Error = - // Local Error structures are listed here - | DynamoDbItemEncryptorException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) - | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations - function method DefaultDynamoDbItemEncryptorConfig(): DynamoDbItemEncryptorConfig - method DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig := DefaultDynamoDbItemEncryptorConfig()) - returns (res: Result) - requires config.keyring.Some? ==> - config.keyring.value.ValidState() - requires config.cmm.Some? ==> - config.cmm.value.ValidState() - requires config.legacyOverride.Some? ==> - config.legacyOverride.value.encryptor.ValidState() - modifies if config.keyring.Some? then - config.keyring.value.Modifies - else {} - modifies if config.cmm.Some? then - config.cmm.value.Modifies - else {} - modifies if config.legacyOverride.Some? then - config.legacyOverride.value.encryptor.Modifies - else {} - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies - - ( if config.keyring.Some? then - config.keyring.value.Modifies - else {} - ) - ( if config.cmm.Some? then - config.cmm.value.Modifies - else {} - ) - ( if config.legacyOverride.Some? then - config.legacyOverride.value.encryptor.Modifies - else {} - ) ) - && fresh(res.value.History) - && res.value.ValidState() - ensures config.keyring.Some? ==> - config.keyring.value.ValidState() - ensures config.cmm.Some? ==> - config.cmm.value.ValidState() - ensures config.legacyOverride.Some? ==> - config.legacyOverride.value.encryptor.ValidState() + // Begin Generated Types - // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals - function method CreateSuccessOfClient(client: IDynamoDbItemEncryptorClient): Result { - Success(client) - } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals - function method CreateFailureOfError(error: Error): Result { - Failure(error) - } - class DynamoDbItemEncryptorClient extends IDynamoDbItemEncryptorClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - {Operations.EncryptItemEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method EncryptItem ( input: EncryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`EncryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures EncryptItemEnsuresPublicly(input, output) - ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] - { - output := Operations.EncryptItem(config, input); - History.EncryptItem := History.EncryptItem + [DafnyCallEvent(input, output)]; -} - - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - {Operations.DecryptItemEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DecryptItem ( input: DecryptItemInput ) - returns (output: Result) - requires - && ValidState() - modifies Modifies - {History} , - History`DecryptItem - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} - ensures - && ValidState() - ensures DecryptItemEnsuresPublicly(input, output) - ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] - { - output := Operations.DecryptItem(config, input); - History.DecryptItem := History.DecryptItem + [DafnyCallEvent(input, output)]; -} - + datatype DecryptItemInput = | DecryptItemInput ( + nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap + ) + datatype DecryptItemOutput = | DecryptItemOutput ( + nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly parsedHeader: Option := Option.None + ) + class IDynamoDbItemEncryptorClientCallHistory { + ghost constructor() { + EncryptItem := []; + DecryptItem := []; + } + ghost var EncryptItem: seq>> + ghost var DecryptItem: seq>> + } + trait {:termination false} IDynamoDbItemEncryptorClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IDynamoDbItemEncryptorClientCallHistory + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + // The public method to be called by library consumers + method EncryptItem ( input: EncryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`EncryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures EncryptItemEnsuresPublicly(input, output) + ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] + + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + // The public method to be called by library consumers + method DecryptItem ( input: DecryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DecryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DecryptItemEnsuresPublicly(input, output) + ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] + + } + datatype DynamoDbItemEncryptorConfig = | DynamoDbItemEncryptorConfig ( + nameonly logicalTableName: string , + nameonly partitionKeyName: ComAmazonawsDynamodbTypes.KeySchemaAttributeName , + nameonly sortKeyName: Option := Option.None , + nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , + nameonly allowedUnsignedAttributes: Option := Option.None , + nameonly allowedUnsignedAttributePrefix: Option := Option.None , + nameonly algorithmSuiteId: Option := Option.None , + nameonly keyring: Option := Option.None , + nameonly cmm: Option := Option.None , + nameonly legacyOverride: Option := Option.None , + nameonly plaintextOverride: Option := Option.None + ) + datatype EncryptItemInput = | EncryptItemInput ( + nameonly plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap + ) + datatype EncryptItemOutput = | EncryptItemOutput ( + nameonly encryptedItem: ComAmazonawsDynamodbTypes.AttributeMap , + nameonly parsedHeader: Option := Option.None + ) + datatype ParsedHeader = | ParsedHeader ( + nameonly attributeActionsOnEncrypt: AwsCryptographyDbEncryptionSdkDynamoDbTypes.AttributeActions , + nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , + nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , + nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , + nameonly encryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , + nameonly selectorContext: ComAmazonawsDynamodbTypes.Key + ) + datatype Error = + // Local Error structures are listed here + | DynamoDbItemEncryptorException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyDbEncryptionSdkDynamoDb(AwsCryptographyDbEncryptionSdkDynamoDb: AwsCryptographyDbEncryptionSdkDynamoDbTypes.Error) + | AwsCryptographyDbEncryptionSdkStructuredEncryption(AwsCryptographyDbEncryptionSdkStructuredEncryption: AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Error) + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + | ComAmazonawsDynamodb(ComAmazonawsDynamodb: ComAmazonawsDynamodbTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations + function method DefaultDynamoDbItemEncryptorConfig(): DynamoDbItemEncryptorConfig + method DynamoDbItemEncryptor(config: DynamoDbItemEncryptorConfig := DefaultDynamoDbItemEncryptorConfig()) + returns (res: Result) + requires config.keyring.Some? ==> + config.keyring.value.ValidState() + requires config.cmm.Some? ==> + config.cmm.value.ValidState() + requires config.legacyOverride.Some? ==> + config.legacyOverride.value.encryptor.ValidState() + modifies if config.keyring.Some? then + config.keyring.value.Modifies + else {} + modifies if config.cmm.Some? then + config.cmm.value.Modifies + else {} + modifies if config.legacyOverride.Some? then + config.legacyOverride.value.encryptor.Modifies + else {} + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies + - ( if config.keyring.Some? then + config.keyring.value.Modifies + else {} + ) - ( if config.cmm.Some? then + config.cmm.value.Modifies + else {} + ) - ( if config.legacyOverride.Some? then + config.legacyOverride.value.encryptor.Modifies + else {} + ) ) + && fresh(res.value.History) + && res.value.ValidState() + ensures config.keyring.Some? ==> + config.keyring.value.ValidState() + ensures config.cmm.Some? ==> + config.cmm.value.ValidState() + ensures config.legacyOverride.Some? ==> + config.legacyOverride.value.encryptor.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDbItemEncryptorClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class DynamoDbItemEncryptorClient extends IDynamoDbItemEncryptorClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + {Operations.EncryptItemEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method EncryptItem ( input: EncryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`EncryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures EncryptItemEnsuresPublicly(input, output) + ensures History.EncryptItem == old(History.EncryptItem) + [DafnyCallEvent(input, output)] + { + output := Operations.EncryptItem(config, input); + History.EncryptItem := History.EncryptItem + [DafnyCallEvent(input, output)]; + } + + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + {Operations.DecryptItemEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DecryptItem ( input: DecryptItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DecryptItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DecryptItemEnsuresPublicly(input, output) + ensures History.DecryptItem == old(History.DecryptItem) + [DafnyCallEvent(input, output)] + { + output := Operations.DecryptItem(config, input); + History.DecryptItem := History.DecryptItem + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate EncryptItemEnsuresPublicly(input: EncryptItemInput , output: Result) + // The private method to be refined by the library developer - method EncryptItem ( config: InternalConfig , input: EncryptItemInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures EncryptItemEnsuresPublicly(input, output) + method EncryptItem ( config: InternalConfig , input: EncryptItemInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures EncryptItemEnsuresPublicly(input, output) - predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) - // The private method to be refined by the library developer + predicate DecryptItemEnsuresPublicly(input: DecryptItemInput , output: Result) + // The private method to be refined by the library developer - method DecryptItem ( config: InternalConfig , input: DecryptItemInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - modifies ModifiesInternalConfig(config) - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) - ensures - && ValidInternalConfig?(config) - ensures DecryptItemEnsuresPublicly(input, output) + method DecryptItem ( config: InternalConfig , input: DecryptItemInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + modifies ModifiesInternalConfig(config) + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) + ensures + && ValidInternalConfig?(config) + ensures DecryptItemEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy b/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy index 089a96ab8..4c88de3b4 100644 --- a/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy +++ b/DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy @@ -2,346 +2,346 @@ // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. include "../../../../submodules/MaterialProviders/StandardLibrary/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" - include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" - module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types" } AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import AwsCryptographyMaterialProvidersTypes - import AwsCryptographyPrimitivesTypes - // Generic helpers for verification of mock/unit tests. - datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - - // Begin Generated Types - - datatype AuthenticateAction = - | SIGN - | DO_NOT_SIGN - datatype AuthenticateSchema = | AuthenticateSchema ( - nameonly content: AuthenticateSchemaContent , - nameonly attributes: Option := Option.None - ) - type AuthenticateSchemaAttributes = map - datatype AuthenticateSchemaContent = - | Action(Action: AuthenticateAction) - | SchemaMap(SchemaMap: AuthenticateSchemaMap) - | SchemaList(SchemaList: AuthenticateSchemaList) - type AuthenticateSchemaList = seq - type AuthenticateSchemaMap = map - datatype CryptoAction = - | ENCRYPT_AND_SIGN - | SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT - | SIGN_ONLY - | DO_NOTHING - datatype CryptoSchema = | CryptoSchema ( - nameonly content: CryptoSchemaContent , - nameonly attributes: Option := Option.None - ) - type CryptoSchemaAttributes = map - datatype CryptoSchemaContent = - | Action(Action: CryptoAction) - | SchemaMap(SchemaMap: CryptoSchemaMap) - | SchemaList(SchemaList: CryptoSchemaList) - type CryptoSchemaList = seq - type CryptoSchemaMap = map - datatype DecryptStructureInput = | DecryptStructureInput ( - nameonly tableName: string , - nameonly encryptedStructure: StructuredData , - nameonly authenticateSchema: AuthenticateSchema , - nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , - nameonly encryptionContext: Option := Option.None - ) - datatype DecryptStructureOutput = | DecryptStructureOutput ( - nameonly plaintextStructure: StructuredData , - nameonly parsedHeader: ParsedHeader - ) - datatype EncryptStructureInput = | EncryptStructureInput ( - nameonly tableName: string , - nameonly plaintextStructure: StructuredData , - nameonly cryptoSchema: CryptoSchema , - nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , - nameonly algorithmSuiteId: Option := Option.None , - nameonly encryptionContext: Option := Option.None - ) - datatype EncryptStructureOutput = | EncryptStructureOutput ( - nameonly encryptedStructure: StructuredData , - nameonly parsedHeader: ParsedHeader - ) - datatype ParsedHeader = | ParsedHeader ( - nameonly cryptoSchema: CryptoSchema , - nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , - nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , - nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , - nameonly encryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext - ) - datatype StructuredData = | StructuredData ( - nameonly content: StructuredDataContent , - nameonly attributes: Option := Option.None - ) - type StructuredDataAttributes = map - datatype StructuredDataContent = - | Terminal(Terminal: StructuredDataTerminal) - | DataList(DataList: StructuredDataList) - | DataMap(DataMap: StructuredDataMap) - type StructuredDataList = seq - type StructuredDataMap = map - datatype StructuredDataTerminal = | StructuredDataTerminal ( - nameonly value: TerminalValue , - nameonly typeId: TerminalTypeId - ) - class IStructuredEncryptionClientCallHistory { - ghost constructor() { - EncryptStructure := []; - DecryptStructure := []; -} - ghost var EncryptStructure: seq>> - ghost var DecryptStructure: seq>> -} - trait {:termination false} IStructuredEncryptionClient - { - // Helper to define any additional modifies/reads clauses. - // If your operations need to mutate state, - // add it in your constructor function: - // Modifies := {your, fields, here, History}; - // If you do not need to mutate anything: -// Modifies := {History}; +include "../../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy" +include "../../../../submodules/MaterialProviders/AwsCryptographyPrimitives/src/Index.dfy" +module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types" } AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import AwsCryptographyMaterialProvidersTypes + import AwsCryptographyPrimitivesTypes + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) - ghost const Modifies: set - // For an unassigned field defined in a trait, - // Dafny can only assign a value in the constructor. - // This means that for Dafny to reason about this value, - // it needs some way to know (an invariant), - // about the state of the object. - // This builds on the Valid/Repr paradigm - // To make this kind requires safe to add - // to methods called from unverified code, - // the predicate MUST NOT take any arguments. - // This means that the correctness of this requires - // MUST only be evaluated by the class itself. - // If you require any additional mutation, - // then you MUST ensure everything you need in ValidState. - // You MUST also ensure ValidState in your constructor. - predicate ValidState() - ensures ValidState() ==> History in Modifies - ghost const History: IStructuredEncryptionClientCallHistory - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - // The public method to be called by library consumers - method EncryptStructure ( input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`EncryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures EncryptStructureEnsuresPublicly(input, output) - ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] - - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - // The public method to be called by library consumers - method DecryptStructure ( input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`DecryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures DecryptStructureEnsuresPublicly(input, output) - ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] - -} - datatype StructuredEncryptionConfig = | StructuredEncryptionConfig ( - - ) - type TerminalTypeId = x: seq | IsValid_TerminalTypeId(x) witness * - predicate method IsValid_TerminalTypeId(x: seq) { - ( 2 <= |x| <= 2 ) -} - type TerminalValue = seq - type Version = x: int32 | IsValid_Version(x) witness * - predicate method IsValid_Version(x: int32) { - ( 1 <= x <= 1 ) -} - datatype Error = - // Local Error structures are listed here - | StructuredEncryptionException ( - nameonly message: string - ) - // Any dependent models are listed here - | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) - | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) - // The Collection error is used to collect several errors together - // This is useful when composing OR logic. - // Consider the following method: - // - // method FN(n:I) - // returns (res: Result) - // ensures A(I).Success? ==> res.Success? - // ensures B(I).Success? ==> res.Success? - // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? - // - // If either A || B is successful then FN is successful. - // And if A && B fail then FN will fail. - // But what information should FN transmit back to the caller? - // While it may be correct to hide these details from the caller, - // this can not be the globally correct option. - // Suppose that A and B can be blocked by different ACLs, - // and that their representation of I is only eventually consistent. - // How can the caller distinguish, at a minimum for logging, - // the difference between the four failure modes? - // || (!access(A(I)) && !access(B(I))) - // || (!exit(A(I)) && !exit(B(I))) - // || (!access(A(I)) && !exit(B(I))) - // || (!exit(A(I)) && !access(B(I))) - | CollectionOfErrors(list: seq, nameonly message: string) - // The Opaque error, used for native, extern, wrapped or unknown errors - | Opaque(obj: object) - type OpaqueError = e: Error | e.Opaque? witness * -} - abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionService - { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - import Operations : AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations - function method DefaultStructuredEncryptionConfig(): StructuredEncryptionConfig - method StructuredEncryption(config: StructuredEncryptionConfig := DefaultStructuredEncryptionConfig()) - returns (res: Result) - ensures res.Success? ==> - && fresh(res.value) - && fresh(res.value.Modifies) - && fresh(res.value.History) - && res.value.ValidState() + // Begin Generated Types - // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals - function method CreateSuccessOfClient(client: IStructuredEncryptionClient): Result { - Success(client) - } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals - function method CreateFailureOfError(error: Error): Result { - Failure(error) - } - class StructuredEncryptionClient extends IStructuredEncryptionClient - { - constructor(config: Operations.InternalConfig) - requires Operations.ValidInternalConfig?(config) - ensures - && ValidState() - && fresh(History) - && this.config == config - const config: Operations.InternalConfig - predicate ValidState() - ensures ValidState() ==> - && Operations.ValidInternalConfig?(config) - && History !in Operations.ModifiesInternalConfig(config) - && Modifies == Operations.ModifiesInternalConfig(config) + {History} - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - {Operations.EncryptStructureEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method EncryptStructure ( input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`EncryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures EncryptStructureEnsuresPublicly(input, output) - ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] - { - output := Operations.EncryptStructure(config, input); - History.EncryptStructure := History.EncryptStructure + [DafnyCallEvent(input, output)]; -} - - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - {Operations.DecryptStructureEnsuresPublicly(input, output)} - // The public method to be called by library consumers - method DecryptStructure ( input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidState() - && input.cmm.ValidState() - && input.cmm.Modifies !! {History} - modifies Modifies - {History} , - input.cmm.Modifies , - History`DecryptStructure - // Dafny will skip type parameters when generating a default decreases clause. - decreases Modifies - {History} , - input.cmm.Modifies - ensures - && ValidState() - ensures DecryptStructureEnsuresPublicly(input, output) - ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] - { - output := Operations.DecryptStructure(config, input); - History.DecryptStructure := History.DecryptStructure + [DafnyCallEvent(input, output)]; -} - + datatype AuthenticateAction = + | SIGN + | DO_NOT_SIGN + datatype AuthenticateSchema = | AuthenticateSchema ( + nameonly content: AuthenticateSchemaContent , + nameonly attributes: Option := Option.None + ) + type AuthenticateSchemaAttributes = map + datatype AuthenticateSchemaContent = + | Action(Action: AuthenticateAction) + | SchemaMap(SchemaMap: AuthenticateSchemaMap) + | SchemaList(SchemaList: AuthenticateSchemaList) + type AuthenticateSchemaList = seq + type AuthenticateSchemaMap = map + datatype CryptoAction = + | ENCRYPT_AND_SIGN + | SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT + | SIGN_ONLY + | DO_NOTHING + datatype CryptoSchema = | CryptoSchema ( + nameonly content: CryptoSchemaContent , + nameonly attributes: Option := Option.None + ) + type CryptoSchemaAttributes = map + datatype CryptoSchemaContent = + | Action(Action: CryptoAction) + | SchemaMap(SchemaMap: CryptoSchemaMap) + | SchemaList(SchemaList: CryptoSchemaList) + type CryptoSchemaList = seq + type CryptoSchemaMap = map + datatype DecryptStructureInput = | DecryptStructureInput ( + nameonly tableName: string , + nameonly encryptedStructure: StructuredData , + nameonly authenticateSchema: AuthenticateSchema , + nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , + nameonly encryptionContext: Option := Option.None + ) + datatype DecryptStructureOutput = | DecryptStructureOutput ( + nameonly plaintextStructure: StructuredData , + nameonly parsedHeader: ParsedHeader + ) + datatype EncryptStructureInput = | EncryptStructureInput ( + nameonly tableName: string , + nameonly plaintextStructure: StructuredData , + nameonly cryptoSchema: CryptoSchema , + nameonly cmm: AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager , + nameonly algorithmSuiteId: Option := Option.None , + nameonly encryptionContext: Option := Option.None + ) + datatype EncryptStructureOutput = | EncryptStructureOutput ( + nameonly encryptedStructure: StructuredData , + nameonly parsedHeader: ParsedHeader + ) + datatype ParsedHeader = | ParsedHeader ( + nameonly cryptoSchema: CryptoSchema , + nameonly algorithmSuiteId: AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId , + nameonly encryptedDataKeys: AwsCryptographyMaterialProvidersTypes.EncryptedDataKeyList , + nameonly storedEncryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext , + nameonly encryptionContext: AwsCryptographyMaterialProvidersTypes.EncryptionContext + ) + datatype StructuredData = | StructuredData ( + nameonly content: StructuredDataContent , + nameonly attributes: Option := Option.None + ) + type StructuredDataAttributes = map + datatype StructuredDataContent = + | Terminal(Terminal: StructuredDataTerminal) + | DataList(DataList: StructuredDataList) + | DataMap(DataMap: StructuredDataMap) + type StructuredDataList = seq + type StructuredDataMap = map + datatype StructuredDataTerminal = | StructuredDataTerminal ( + nameonly value: TerminalValue , + nameonly typeId: TerminalTypeId + ) + class IStructuredEncryptionClientCallHistory { + ghost constructor() { + EncryptStructure := []; + DecryptStructure := []; + } + ghost var EncryptStructure: seq>> + ghost var DecryptStructure: seq>> + } + trait {:termination false} IStructuredEncryptionClient + { + // Helper to define any additional modifies/reads clauses. + // If your operations need to mutate state, + // add it in your constructor function: + // Modifies := {your, fields, here, History}; + // If you do not need to mutate anything: + // Modifies := {History}; + + ghost const Modifies: set + // For an unassigned field defined in a trait, + // Dafny can only assign a value in the constructor. + // This means that for Dafny to reason about this value, + // it needs some way to know (an invariant), + // about the state of the object. + // This builds on the Valid/Repr paradigm + // To make this kind requires safe to add + // to methods called from unverified code, + // the predicate MUST NOT take any arguments. + // This means that the correctness of this requires + // MUST only be evaluated by the class itself. + // If you require any additional mutation, + // then you MUST ensure everything you need in ValidState. + // You MUST also ensure ValidState in your constructor. + predicate ValidState() + ensures ValidState() ==> History in Modifies + ghost const History: IStructuredEncryptionClientCallHistory + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + // The public method to be called by library consumers + method EncryptStructure ( input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`EncryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures EncryptStructureEnsuresPublicly(input, output) + ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] + + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + // The public method to be called by library consumers + method DecryptStructure ( input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`DecryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures DecryptStructureEnsuresPublicly(input, output) + ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] + + } + datatype StructuredEncryptionConfig = | StructuredEncryptionConfig ( + + ) + type TerminalTypeId = x: seq | IsValid_TerminalTypeId(x) witness * + predicate method IsValid_TerminalTypeId(x: seq) { + ( 2 <= |x| <= 2 ) + } + type TerminalValue = seq + type Version = x: int32 | IsValid_Version(x) witness * + predicate method IsValid_Version(x: int32) { + ( 1 <= x <= 1 ) + } + datatype Error = + // Local Error structures are listed here + | StructuredEncryptionException ( + nameonly message: string + ) + // Any dependent models are listed here + | AwsCryptographyMaterialProviders(AwsCryptographyMaterialProviders: AwsCryptographyMaterialProvidersTypes.Error) + | AwsCryptographyPrimitives(AwsCryptographyPrimitives: AwsCryptographyPrimitivesTypes.Error) + // The Collection error is used to collect several errors together + // This is useful when composing OR logic. + // Consider the following method: + // + // method FN(n:I) + // returns (res: Result) + // ensures A(I).Success? ==> res.Success? + // ensures B(I).Success? ==> res.Success? + // ensures A(I).Failure? && B(I).Failure? ==> res.Failure? + // + // If either A || B is successful then FN is successful. + // And if A && B fail then FN will fail. + // But what information should FN transmit back to the caller? + // While it may be correct to hide these details from the caller, + // this can not be the globally correct option. + // Suppose that A and B can be blocked by different ACLs, + // and that their representation of I is only eventually consistent. + // How can the caller distinguish, at a minimum for logging, + // the difference between the four failure modes? + // || (!access(A(I)) && !access(B(I))) + // || (!exit(A(I)) && !exit(B(I))) + // || (!access(A(I)) && !exit(B(I))) + // || (!exit(A(I)) && !access(B(I))) + | CollectionOfErrors(list: seq, nameonly message: string) + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * } +abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionService +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + import Operations : AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations + function method DefaultStructuredEncryptionConfig(): StructuredEncryptionConfig + method StructuredEncryption(config: StructuredEncryptionConfig := DefaultStructuredEncryptionConfig()) + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() + + // Helper function for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IStructuredEncryptionClient): Result { + Success(client) + } // Helper function for the benefit of native code to create a Failure(error) without referring to Dafny internals + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } + class StructuredEncryptionClient extends IStructuredEncryptionClient + { + constructor(config: Operations.InternalConfig) + requires Operations.ValidInternalConfig?(config) + ensures + && ValidState() + && fresh(History) + && this.config == config + const config: Operations.InternalConfig + predicate ValidState() + ensures ValidState() ==> + && Operations.ValidInternalConfig?(config) + && History !in Operations.ModifiesInternalConfig(config) + && Modifies == Operations.ModifiesInternalConfig(config) + {History} + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + {Operations.EncryptStructureEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method EncryptStructure ( input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`EncryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures EncryptStructureEnsuresPublicly(input, output) + ensures History.EncryptStructure == old(History.EncryptStructure) + [DafnyCallEvent(input, output)] + { + output := Operations.EncryptStructure(config, input); + History.EncryptStructure := History.EncryptStructure + [DafnyCallEvent(input, output)]; + } + + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + {Operations.DecryptStructureEnsuresPublicly(input, output)} + // The public method to be called by library consumers + method DecryptStructure ( input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidState() + && input.cmm.ValidState() + && input.cmm.Modifies !! {History} + modifies Modifies - {History} , + input.cmm.Modifies , + History`DecryptStructure + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} , + input.cmm.Modifies + ensures + && ValidState() + ensures DecryptStructureEnsuresPublicly(input, output) + ensures History.DecryptStructure == old(History.DecryptStructure) + [DafnyCallEvent(input, output)] + { + output := Operations.DecryptStructure(config, input); + History.DecryptStructure := History.DecryptStructure + [DafnyCallEvent(input, output)]; + } + + } } - abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations { - import opened Wrappers - import opened StandardLibrary.UInt - import opened UTF8 - import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes - type InternalConfig - predicate ValidInternalConfig?(config: InternalConfig) - function ModifiesInternalConfig(config: InternalConfig): set - predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) - // The private method to be refined by the library developer +abstract module AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate EncryptStructureEnsuresPublicly(input: EncryptStructureInput , output: Result) + // The private method to be refined by the library developer - method EncryptStructure ( config: InternalConfig , input: EncryptStructureInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.cmm.ValidState() - modifies ModifiesInternalConfig(config) , - input.cmm.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.cmm.Modifies - ensures - && ValidInternalConfig?(config) - ensures EncryptStructureEnsuresPublicly(input, output) + method EncryptStructure ( config: InternalConfig , input: EncryptStructureInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.cmm.ValidState() + modifies ModifiesInternalConfig(config) , + input.cmm.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.cmm.Modifies + ensures + && ValidInternalConfig?(config) + ensures EncryptStructureEnsuresPublicly(input, output) - predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) - // The private method to be refined by the library developer + predicate DecryptStructureEnsuresPublicly(input: DecryptStructureInput , output: Result) + // The private method to be refined by the library developer - method DecryptStructure ( config: InternalConfig , input: DecryptStructureInput ) - returns (output: Result) - requires - && ValidInternalConfig?(config) - && input.cmm.ValidState() - modifies ModifiesInternalConfig(config) , - input.cmm.Modifies - // Dafny will skip type parameters when generating a default decreases clause. - decreases ModifiesInternalConfig(config) , - input.cmm.Modifies - ensures - && ValidInternalConfig?(config) - ensures DecryptStructureEnsuresPublicly(input, output) + method DecryptStructure ( config: InternalConfig , input: DecryptStructureInput ) + returns (output: Result) + requires + && ValidInternalConfig?(config) + && input.cmm.ValidState() + modifies ModifiesInternalConfig(config) , + input.cmm.Modifies + // Dafny will skip type parameters when generating a default decreases clause. + decreases ModifiesInternalConfig(config) , + input.cmm.Modifies + ensures + && ValidInternalConfig?(config) + ensures DecryptStructureEnsuresPublicly(input, output) } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java index b44d6b65a..ec09ed123 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/DynamoDbEncryption.java @@ -14,12 +14,15 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.model.DynamoDbEncryptionConfig; public class DynamoDbEncryption { + private final IDynamoDbEncryptionClient _impl; protected DynamoDbEncryption(BuilderImpl builder) { DynamoDbEncryptionConfig input = builder.DynamoDbEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue = ToDafny.DynamoDbEncryptionConfig(input); - Result result = __default.DynamoDbEncryption(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbEncryptionConfig dafnyValue = + ToDafny.DynamoDbEncryptionConfig(input); + Result result = + __default.DynamoDbEncryption(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -41,13 +44,21 @@ public static Builder builder() { * @return Outputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier */ public CreateDynamoDbEncryptionBranchKeyIdSupplierOutput CreateDynamoDbEncryptionBranchKeyIdSupplier( - CreateDynamoDbEncryptionBranchKeyIdSupplierInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue = ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(input); - Result result = this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(dafnyValue); + CreateDynamoDbEncryptionBranchKeyIdSupplierInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierInput dafnyValue = + ToDafny.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput, + Error + > result = + this._impl.CreateDynamoDbEncryptionBranchKeyIdSupplier(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(result.dtor_value()); + return ToNative.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput( + result.dtor_value() + ); } protected IDynamoDbEncryptionClient impl() { @@ -55,7 +66,9 @@ protected IDynamoDbEncryptionClient impl() { } public interface Builder { - Builder DynamoDbEncryptionConfig(DynamoDbEncryptionConfig DynamoDbEncryptionConfig); + Builder DynamoDbEncryptionConfig( + DynamoDbEncryptionConfig DynamoDbEncryptionConfig + ); DynamoDbEncryptionConfig DynamoDbEncryptionConfig(); @@ -63,12 +76,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DynamoDbEncryptionConfig DynamoDbEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} - public Builder DynamoDbEncryptionConfig(DynamoDbEncryptionConfig DynamoDbEncryptionConfig) { + public Builder DynamoDbEncryptionConfig( + DynamoDbEncryptionConfig DynamoDbEncryptionConfig + ) { this.DynamoDbEncryptionConfig = DynamoDbEncryptionConfig; return this; } @@ -78,8 +93,10 @@ public DynamoDbEncryptionConfig DynamoDbEncryptionConfig() { } public DynamoDbEncryption build() { - if (Objects.isNull(this.DynamoDbEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbEncryptionConfig`"); + if (Objects.isNull(this.DynamoDbEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbEncryptionConfig`" + ); } return new DynamoDbEncryption(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java index 422764b6d..9d842924b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/DynamoDbItemEncryptor.java @@ -16,12 +16,15 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput; public class DynamoDbItemEncryptor { + private final IDynamoDbItemEncryptorClient _impl; protected DynamoDbItemEncryptor(BuilderImpl builder) { DynamoDbItemEncryptorConfig input = builder.DynamoDbItemEncryptorConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue = ToDafny.DynamoDbItemEncryptorConfig(input); - Result result = __default.DynamoDbItemEncryptor(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue = + ToDafny.DynamoDbItemEncryptorConfig(input); + Result result = + __default.DynamoDbItemEncryptor(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -43,8 +46,12 @@ public static Builder builder() { * @return Outputs for decrypting a DynamoDB Item. */ public DecryptItemOutput DecryptItem(DecryptItemInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue = ToDafny.DecryptItemInput(input); - Result result = this._impl.DecryptItem(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue = + ToDafny.DecryptItemInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput, + Error + > result = this._impl.DecryptItem(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -58,8 +65,12 @@ public DecryptItemOutput DecryptItem(DecryptItemInput input) { * @return Outputs for encrypting a DynamoDB Item. */ public EncryptItemOutput EncryptItem(EncryptItemInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue = ToDafny.EncryptItemInput(input); - Result result = this._impl.EncryptItem(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue = + ToDafny.EncryptItemInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput, + Error + > result = this._impl.EncryptItem(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -74,7 +85,9 @@ public interface Builder { /** * @param DynamoDbItemEncryptorConfig The configuration for the client-side encryption of DynamoDB items. */ - Builder DynamoDbItemEncryptorConfig(DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig); + Builder DynamoDbItemEncryptorConfig( + DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig + ); /** * @return The configuration for the client-side encryption of DynamoDB items. @@ -85,13 +98,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder DynamoDbItemEncryptorConfig( - DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig) { + DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig + ) { this.DynamoDbItemEncryptorConfig = DynamoDbItemEncryptorConfig; return this; } @@ -101,8 +115,10 @@ public DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig() { } public DynamoDbItemEncryptor build() { - if (Objects.isNull(this.DynamoDbItemEncryptorConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbItemEncryptorConfig`"); + if (Objects.isNull(this.DynamoDbItemEncryptorConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbItemEncryptorConfig`" + ); } return new DynamoDbItemEncryptor(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java index da8714f8b..c0ea35b5a 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToDafny.java @@ -32,6 +32,7 @@ import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof DynamoDbItemEncryptorException) { return ToDafny.Error((DynamoDbItemEncryptorException) nativeValue); @@ -50,118 +51,263 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static DecryptItemInput DecryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemInput nativeValue) { - DafnyMap, ? extends AttributeValue> encryptedItem; - encryptedItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.encryptedItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemInput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > encryptedItem; + encryptedItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.encryptedItem() + ); return new DecryptItemInput(encryptedItem); } public static DecryptItemOutput DecryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemOutput nativeValue) { - DafnyMap, ? extends AttributeValue> plaintextItem; - plaintextItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.plaintextItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DecryptItemOutput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > plaintextItem; + plaintextItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.plaintextItem() + ); Option parsedHeader; - parsedHeader = Objects.nonNull(nativeValue.parsedHeader()) ? - Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) + parsedHeader = + Objects.nonNull(nativeValue.parsedHeader()) + ? Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) : Option.create_None(); return new DecryptItemOutput(plaintextItem, parsedHeader); } public static DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DynamoDbItemEncryptorConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DynamoDbItemEncryptorConfig nativeValue + ) { DafnySequence logicalTableName; - logicalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.logicalTableName()); + logicalTableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.logicalTableName() + ); DafnySequence partitionKeyName; - partitionKeyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.partitionKeyName()); + partitionKeyName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.partitionKeyName() + ); Option> sortKeyName; - sortKeyName = Objects.nonNull(nativeValue.sortKeyName()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sortKeyName())) + sortKeyName = + Objects.nonNull(nativeValue.sortKeyName()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.sortKeyName() + ) + ) : Option.create_None(); - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); - Option>> allowedUnsignedAttributes; - allowedUnsignedAttributes = (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && nativeValue.allowedUnsignedAttributes().size() > 0) ? - Option.create_Some(software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList(nativeValue.allowedUnsignedAttributes())) + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions( + nativeValue.attributeActionsOnEncrypt() + ); + Option< + DafnySequence> + > allowedUnsignedAttributes; + allowedUnsignedAttributes = + (Objects.nonNull(nativeValue.allowedUnsignedAttributes()) && + nativeValue.allowedUnsignedAttributes().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList( + nativeValue.allowedUnsignedAttributes() + ) + ) : Option.create_None(); Option> allowedUnsignedAttributePrefix; - allowedUnsignedAttributePrefix = Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) ? - Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.allowedUnsignedAttributePrefix())) + allowedUnsignedAttributePrefix = + Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix()) + ? Option.create_Some( + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.allowedUnsignedAttributePrefix() + ) + ) : Option.create_None(); Option algorithmSuiteId; - algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId())) + algorithmSuiteId = + Objects.nonNull(nativeValue.algorithmSuiteId()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ) + ) : Option.create_None(); Option keyring; - keyring = Objects.nonNull(nativeValue.keyring()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.Keyring(nativeValue.keyring())) + keyring = + Objects.nonNull(nativeValue.keyring()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.Keyring( + nativeValue.keyring() + ) + ) : Option.create_None(); Option cmm; - cmm = Objects.nonNull(nativeValue.cmm()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm())) + cmm = + Objects.nonNull(nativeValue.cmm()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ) + ) : Option.create_None(); Option legacyOverride; - legacyOverride = Objects.nonNull(nativeValue.legacyOverride()) ? - Option.create_Some(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.LegacyOverride(nativeValue.legacyOverride())) + legacyOverride = + Objects.nonNull(nativeValue.legacyOverride()) + ? Option.create_Some( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.LegacyOverride( + nativeValue.legacyOverride() + ) + ) : Option.create_None(); Option plaintextOverride; - plaintextOverride = Objects.nonNull(nativeValue.plaintextOverride()) ? - Option.create_Some(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.PlaintextOverride(nativeValue.plaintextOverride())) + plaintextOverride = + Objects.nonNull(nativeValue.plaintextOverride()) + ? Option.create_Some( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.PlaintextOverride( + nativeValue.plaintextOverride() + ) + ) : Option.create_None(); - return new DynamoDbItemEncryptorConfig(logicalTableName, partitionKeyName, sortKeyName, attributeActionsOnEncrypt, allowedUnsignedAttributes, allowedUnsignedAttributePrefix, algorithmSuiteId, keyring, cmm, legacyOverride, plaintextOverride); + return new DynamoDbItemEncryptorConfig( + logicalTableName, + partitionKeyName, + sortKeyName, + attributeActionsOnEncrypt, + allowedUnsignedAttributes, + allowedUnsignedAttributePrefix, + algorithmSuiteId, + keyring, + cmm, + legacyOverride, + plaintextOverride + ); } public static EncryptItemInput EncryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemInput nativeValue) { - DafnyMap, ? extends AttributeValue> plaintextItem; - plaintextItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.plaintextItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemInput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > plaintextItem; + plaintextItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.plaintextItem() + ); return new EncryptItemInput(plaintextItem); } public static EncryptItemOutput EncryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput nativeValue) { - DafnyMap, ? extends AttributeValue> encryptedItem; - encryptedItem = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.encryptedItem()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.EncryptItemOutput nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > encryptedItem; + encryptedItem = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap( + nativeValue.encryptedItem() + ); Option parsedHeader; - parsedHeader = Objects.nonNull(nativeValue.parsedHeader()) ? - Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) + parsedHeader = + Objects.nonNull(nativeValue.parsedHeader()) + ? Option.create_Some(ToDafny.ParsedHeader(nativeValue.parsedHeader())) : Option.create_None(); return new EncryptItemOutput(encryptedItem, parsedHeader); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader nativeValue) { - DafnyMap, ? extends CryptoAction> attributeActionsOnEncrypt; - attributeActionsOnEncrypt = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions(nativeValue.attributeActionsOnEncrypt()); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader nativeValue + ) { + DafnyMap< + ? extends DafnySequence, + ? extends CryptoAction + > attributeActionsOnEncrypt; + attributeActionsOnEncrypt = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.AttributeActions( + nativeValue.attributeActionsOnEncrypt() + ); DBEAlgorithmSuiteId algorithmSuiteId; - algorithmSuiteId = software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId()); + algorithmSuiteId = + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ); DafnySequence encryptedDataKeys; - encryptedDataKeys = software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys()); - DafnyMap, ? extends DafnySequence> storedEncryptionContext; - storedEncryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.storedEncryptionContext()); - DafnyMap, ? extends DafnySequence> encryptionContext; - encryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext()); - DafnyMap, ? extends AttributeValue> selectorContext; - selectorContext = software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.Key(nativeValue.selectorContext()); - return new ParsedHeader(attributeActionsOnEncrypt, algorithmSuiteId, encryptedDataKeys, storedEncryptionContext, encryptionContext, selectorContext); + encryptedDataKeys = + software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList( + nativeValue.encryptedDataKeys() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > storedEncryptionContext; + storedEncryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.storedEncryptionContext() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > encryptionContext; + encryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ); + DafnyMap< + ? extends DafnySequence, + ? extends AttributeValue + > selectorContext; + selectorContext = + software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.Key( + nativeValue.selectorContext() + ); + return new ParsedHeader( + attributeActionsOnEncrypt, + algorithmSuiteId, + encryptedDataKeys, + storedEncryptionContext, + encryptionContext, + selectorContext + ); } public static Error Error(DynamoDbItemEncryptorException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_DynamoDbItemEncryptorException(message); } public static IDynamoDbItemEncryptorClient DynamoDbItemEncryptor( - DynamoDbItemEncryptor nativeValue) { + DynamoDbItemEncryptor nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java index 02c93dfcb..327af1b36 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/ToNative.java @@ -20,6 +20,7 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.ParsedHeader; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -29,17 +30,29 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static DynamoDbItemEncryptorException Error( - Error_DynamoDbItemEncryptorException dafnyValue) { - DynamoDbItemEncryptorException.Builder nativeBuilder = DynamoDbItemEncryptorException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + Error_DynamoDbItemEncryptorException dafnyValue + ) { + DynamoDbItemEncryptorException.Builder nativeBuilder = + DynamoDbItemEncryptorException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } @@ -54,19 +67,29 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_AwsCryptographyPrimitives()) { - return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives()); + return software.amazon.cryptography.primitives.ToNative.Error( + dafnyValue.dtor_AwsCryptographyPrimitives() + ); } if (dafnyValue.is_ComAmazonawsDynamodb()) { - return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsDynamodb()); + return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error( + dafnyValue.dtor_ComAmazonawsDynamodb() + ); } if (dafnyValue.is_AwsCryptographyMaterialProviders()) { - return software.amazon.cryptography.materialproviders.ToNative.Error(dafnyValue.dtor_AwsCryptographyMaterialProviders()); + return software.amazon.cryptography.materialproviders.ToNative.Error( + dafnyValue.dtor_AwsCryptographyMaterialProviders() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkStructuredEncryption()) { - return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption()); + return software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkStructuredEncryption() + ); } if (dafnyValue.is_AwsCryptographyDbEncryptionSdkDynamoDb()) { - return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error(dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb()); + return software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.Error( + dafnyValue.dtor_AwsCryptographyDbEncryptionSdkDynamoDb() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -74,86 +97,182 @@ public static RuntimeException Error(Error dafnyValue) { } public static DecryptItemInput DecryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput dafnyValue + ) { DecryptItemInput.Builder nativeBuilder = DecryptItemInput.builder(); - nativeBuilder.encryptedItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_encryptedItem())); + nativeBuilder.encryptedItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_encryptedItem() + ) + ); return nativeBuilder.build(); } public static DecryptItemOutput DecryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemOutput dafnyValue + ) { DecryptItemOutput.Builder nativeBuilder = DecryptItemOutput.builder(); - nativeBuilder.plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_plaintextItem())); + nativeBuilder.plaintextItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_plaintextItem() + ) + ); if (dafnyValue.dtor_parsedHeader().is_Some()) { - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value())); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value()) + ); } return nativeBuilder.build(); } public static DynamoDbItemEncryptorConfig DynamoDbItemEncryptorConfig( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue) { - DynamoDbItemEncryptorConfig.Builder nativeBuilder = DynamoDbItemEncryptorConfig.builder(); - nativeBuilder.logicalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_logicalTableName())); - nativeBuilder.partitionKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_partitionKeyName())); + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DynamoDbItemEncryptorConfig dafnyValue + ) { + DynamoDbItemEncryptorConfig.Builder nativeBuilder = + DynamoDbItemEncryptorConfig.builder(); + nativeBuilder.logicalTableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_logicalTableName() + ) + ); + nativeBuilder.partitionKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_partitionKeyName() + ) + ); if (dafnyValue.dtor_sortKeyName().is_Some()) { - nativeBuilder.sortKeyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_sortKeyName().dtor_value())); + nativeBuilder.sortKeyName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_sortKeyName().dtor_value() + ) + ); } - nativeBuilder.attributeActionsOnEncrypt(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); + nativeBuilder.attributeActionsOnEncrypt( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions( + dafnyValue.dtor_attributeActionsOnEncrypt() + ) + ); if (dafnyValue.dtor_allowedUnsignedAttributes().is_Some()) { - nativeBuilder.allowedUnsignedAttributes(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList(dafnyValue.dtor_allowedUnsignedAttributes().dtor_value())); + nativeBuilder.allowedUnsignedAttributes( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeNameList( + dafnyValue.dtor_allowedUnsignedAttributes().dtor_value() + ) + ); } if (dafnyValue.dtor_allowedUnsignedAttributePrefix().is_Some()) { - nativeBuilder.allowedUnsignedAttributePrefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value())); + nativeBuilder.allowedUnsignedAttributePrefix( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_allowedUnsignedAttributePrefix().dtor_value() + ) + ); } if (dafnyValue.dtor_algorithmSuiteId().is_Some()) { - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value())); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId().dtor_value() + ) + ); } if (dafnyValue.dtor_keyring().is_Some()) { - nativeBuilder.keyring(software.amazon.cryptography.materialproviders.ToNative.Keyring(dafnyValue.dtor_keyring().dtor_value())); + nativeBuilder.keyring( + software.amazon.cryptography.materialproviders.ToNative.Keyring( + dafnyValue.dtor_keyring().dtor_value() + ) + ); } if (dafnyValue.dtor_cmm().is_Some()) { - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm().dtor_value())); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm().dtor_value() + ) + ); } if (dafnyValue.dtor_legacyOverride().is_Some()) { - nativeBuilder.legacyOverride(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.LegacyOverride(dafnyValue.dtor_legacyOverride().dtor_value())); + nativeBuilder.legacyOverride( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.LegacyOverride( + dafnyValue.dtor_legacyOverride().dtor_value() + ) + ); } if (dafnyValue.dtor_plaintextOverride().is_Some()) { - nativeBuilder.plaintextOverride(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.PlaintextOverride(dafnyValue.dtor_plaintextOverride().dtor_value())); + nativeBuilder.plaintextOverride( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.PlaintextOverride( + dafnyValue.dtor_plaintextOverride().dtor_value() + ) + ); } return nativeBuilder.build(); } public static EncryptItemInput EncryptItemInput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemInput dafnyValue + ) { EncryptItemInput.Builder nativeBuilder = EncryptItemInput.builder(); - nativeBuilder.plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_plaintextItem())); + nativeBuilder.plaintextItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_plaintextItem() + ) + ); return nativeBuilder.build(); } public static EncryptItemOutput EncryptItemOutput( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.EncryptItemOutput dafnyValue + ) { EncryptItemOutput.Builder nativeBuilder = EncryptItemOutput.builder(); - nativeBuilder.encryptedItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_encryptedItem())); + nativeBuilder.encryptedItem( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap( + dafnyValue.dtor_encryptedItem() + ) + ); if (dafnyValue.dtor_parsedHeader().is_Some()) { - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value())); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader().dtor_value()) + ); } return nativeBuilder.build(); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.ParsedHeader dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.ParsedHeader dafnyValue + ) { ParsedHeader.Builder nativeBuilder = ParsedHeader.builder(); - nativeBuilder.attributeActionsOnEncrypt(software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions(dafnyValue.dtor_attributeActionsOnEncrypt())); - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId())); - nativeBuilder.encryptedDataKeys(software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys())); - nativeBuilder.storedEncryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_storedEncryptionContext())); - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext())); - nativeBuilder.selectorContext(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Key(dafnyValue.dtor_selectorContext())); + nativeBuilder.attributeActionsOnEncrypt( + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative.AttributeActions( + dafnyValue.dtor_attributeActionsOnEncrypt() + ) + ); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId() + ) + ); + nativeBuilder.encryptedDataKeys( + software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList( + dafnyValue.dtor_encryptedDataKeys() + ) + ); + nativeBuilder.storedEncryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_storedEncryptionContext() + ) + ); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext() + ) + ); + nativeBuilder.selectorContext( + software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Key( + dafnyValue.dtor_selectorContext() + ) + ); return nativeBuilder.build(); } public static DynamoDbItemEncryptor DynamoDbItemEncryptor( - IDynamoDbItemEncryptorClient dafnyValue) { + IDynamoDbItemEncryptorClient dafnyValue + ) { return new DynamoDbItemEncryptor(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java index 72531d67e..2fb8d7545 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/ParsedHeader.java @@ -15,6 +15,7 @@ * A parsed version of the header that was written with or read on an encrypted DynamoDB item. */ public class ParsedHeader { + /** * The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. */ @@ -108,7 +109,9 @@ public interface Builder { /** * @param attributeActionsOnEncrypt The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. */ - Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt); + Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ); /** * @return The non-DO_NOTHING Crypto Actions that were configured when this item was originally encrypted. @@ -138,7 +141,9 @@ public interface Builder { /** * @param storedEncryptionContext The portion of the encryption context that was stored in the header of this item. */ - Builder storedEncryptionContext(Map storedEncryptionContext); + Builder storedEncryptionContext( + Map storedEncryptionContext + ); /** * @return The portion of the encryption context that was stored in the header of this item. @@ -169,6 +174,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected Map attributeActionsOnEncrypt; protected DBEAlgorithmSuiteId algorithmSuiteId; @@ -181,8 +187,7 @@ static class BuilderImpl implements Builder { protected Map selectorContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ParsedHeader model) { this.attributeActionsOnEncrypt = model.attributeActionsOnEncrypt(); @@ -193,7 +198,9 @@ protected BuilderImpl(ParsedHeader model) { this.selectorContext = model.selectorContext(); } - public Builder attributeActionsOnEncrypt(Map attributeActionsOnEncrypt) { + public Builder attributeActionsOnEncrypt( + Map attributeActionsOnEncrypt + ) { this.attributeActionsOnEncrypt = attributeActionsOnEncrypt; return this; } @@ -220,7 +227,9 @@ public List encryptedDataKeys() { return this.encryptedDataKeys; } - public Builder storedEncryptionContext(Map storedEncryptionContext) { + public Builder storedEncryptionContext( + Map storedEncryptionContext + ) { this.storedEncryptionContext = storedEncryptionContext; return this; } @@ -238,7 +247,9 @@ public Map encryptionContext() { return this.encryptionContext; } - public Builder selectorContext(Map selectorContext) { + public Builder selectorContext( + Map selectorContext + ) { this.selectorContext = selectorContext; return this; } @@ -248,23 +259,35 @@ public Map selectorContext() { } public ParsedHeader build() { - if (Objects.isNull(this.attributeActionsOnEncrypt())) { - throw new IllegalArgumentException("Missing value for required field `attributeActionsOnEncrypt`"); + if (Objects.isNull(this.attributeActionsOnEncrypt())) { + throw new IllegalArgumentException( + "Missing value for required field `attributeActionsOnEncrypt`" + ); } - if (Objects.isNull(this.algorithmSuiteId())) { - throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`"); + if (Objects.isNull(this.algorithmSuiteId())) { + throw new IllegalArgumentException( + "Missing value for required field `algorithmSuiteId`" + ); } - if (Objects.isNull(this.encryptedDataKeys())) { - throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`"); + if (Objects.isNull(this.encryptedDataKeys())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedDataKeys`" + ); } - if (Objects.isNull(this.storedEncryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `storedEncryptionContext`"); + if (Objects.isNull(this.storedEncryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `storedEncryptionContext`" + ); } - if (Objects.isNull(this.encryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `encryptionContext`"); + if (Objects.isNull(this.encryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptionContext`" + ); } - if (Objects.isNull(this.selectorContext())) { - throw new IllegalArgumentException("Missing value for required field `selectorContext`"); + if (Objects.isNull(this.selectorContext())) { + throw new IllegalArgumentException( + "Missing value for required field `selectorContext`" + ); } return new ParsedHeader(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java index 35d961639..278d33b07 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/DynamoDbEncryptionTransforms.java @@ -66,12 +66,18 @@ import software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model.UpdateItemOutputTransformOutput; public class DynamoDbEncryptionTransforms { + private final IDynamoDbEncryptionTransformsClient _impl; protected DynamoDbEncryptionTransforms(BuilderImpl builder) { - DynamoDbTablesEncryptionConfig input = builder.DynamoDbTablesEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue = software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.DynamoDbTablesEncryptionConfig(input); - Result result = __default.DynamoDbEncryptionTransforms(dafnyValue); + DynamoDbTablesEncryptionConfig input = + builder.DynamoDbTablesEncryptionConfig(); + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig dafnyValue = + software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny.DynamoDbTablesEncryptionConfig( + input + ); + Result result = + __default.DynamoDbEncryptionTransforms(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -87,29 +93,48 @@ public static Builder builder() { } public BatchExecuteStatementInputTransformOutput BatchExecuteStatementInputTransform( - BatchExecuteStatementInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue = ToDafny.BatchExecuteStatementInputTransformInput(input); - Result result = this._impl.BatchExecuteStatementInputTransform(dafnyValue); + BatchExecuteStatementInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformInput dafnyValue = + ToDafny.BatchExecuteStatementInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementInputTransformOutput, + Error + > result = this._impl.BatchExecuteStatementInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.BatchExecuteStatementInputTransformOutput(result.dtor_value()); + return ToNative.BatchExecuteStatementInputTransformOutput( + result.dtor_value() + ); } public BatchExecuteStatementOutputTransformOutput BatchExecuteStatementOutputTransform( - BatchExecuteStatementOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue = ToDafny.BatchExecuteStatementOutputTransformInput(input); - Result result = this._impl.BatchExecuteStatementOutputTransform(dafnyValue); + BatchExecuteStatementOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformInput dafnyValue = + ToDafny.BatchExecuteStatementOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchExecuteStatementOutputTransformOutput, + Error + > result = this._impl.BatchExecuteStatementOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.BatchExecuteStatementOutputTransformOutput(result.dtor_value()); + return ToNative.BatchExecuteStatementOutputTransformOutput( + result.dtor_value() + ); } public BatchGetItemInputTransformOutput BatchGetItemInputTransform( - BatchGetItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue = ToDafny.BatchGetItemInputTransformInput(input); - Result result = this._impl.BatchGetItemInputTransform(dafnyValue); + BatchGetItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformInput dafnyValue = + ToDafny.BatchGetItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemInputTransformOutput, + Error + > result = this._impl.BatchGetItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -117,9 +142,14 @@ public BatchGetItemInputTransformOutput BatchGetItemInputTransform( } public BatchGetItemOutputTransformOutput BatchGetItemOutputTransform( - BatchGetItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue = ToDafny.BatchGetItemOutputTransformInput(input); - Result result = this._impl.BatchGetItemOutputTransform(dafnyValue); + BatchGetItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformInput dafnyValue = + ToDafny.BatchGetItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchGetItemOutputTransformOutput, + Error + > result = this._impl.BatchGetItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -127,9 +157,14 @@ public BatchGetItemOutputTransformOutput BatchGetItemOutputTransform( } public BatchWriteItemInputTransformOutput BatchWriteItemInputTransform( - BatchWriteItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue = ToDafny.BatchWriteItemInputTransformInput(input); - Result result = this._impl.BatchWriteItemInputTransform(dafnyValue); + BatchWriteItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformInput dafnyValue = + ToDafny.BatchWriteItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemInputTransformOutput, + Error + > result = this._impl.BatchWriteItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -137,9 +172,14 @@ public BatchWriteItemInputTransformOutput BatchWriteItemInputTransform( } public BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransform( - BatchWriteItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue = ToDafny.BatchWriteItemOutputTransformInput(input); - Result result = this._impl.BatchWriteItemOutputTransform(dafnyValue); + BatchWriteItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformInput dafnyValue = + ToDafny.BatchWriteItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.BatchWriteItemOutputTransformOutput, + Error + > result = this._impl.BatchWriteItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -147,9 +187,14 @@ public BatchWriteItemOutputTransformOutput BatchWriteItemOutputTransform( } public DeleteItemInputTransformOutput DeleteItemInputTransform( - DeleteItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue = ToDafny.DeleteItemInputTransformInput(input); - Result result = this._impl.DeleteItemInputTransform(dafnyValue); + DeleteItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformInput dafnyValue = + ToDafny.DeleteItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemInputTransformOutput, + Error + > result = this._impl.DeleteItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -157,9 +202,14 @@ public DeleteItemInputTransformOutput DeleteItemInputTransform( } public DeleteItemOutputTransformOutput DeleteItemOutputTransform( - DeleteItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue = ToDafny.DeleteItemOutputTransformInput(input); - Result result = this._impl.DeleteItemOutputTransform(dafnyValue); + DeleteItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformInput dafnyValue = + ToDafny.DeleteItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.DeleteItemOutputTransformOutput, + Error + > result = this._impl.DeleteItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -167,9 +217,14 @@ public DeleteItemOutputTransformOutput DeleteItemOutputTransform( } public ExecuteStatementInputTransformOutput ExecuteStatementInputTransform( - ExecuteStatementInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue = ToDafny.ExecuteStatementInputTransformInput(input); - Result result = this._impl.ExecuteStatementInputTransform(dafnyValue); + ExecuteStatementInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformInput dafnyValue = + ToDafny.ExecuteStatementInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementInputTransformOutput, + Error + > result = this._impl.ExecuteStatementInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -177,9 +232,14 @@ public ExecuteStatementInputTransformOutput ExecuteStatementInputTransform( } public ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransform( - ExecuteStatementOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue = ToDafny.ExecuteStatementOutputTransformInput(input); - Result result = this._impl.ExecuteStatementOutputTransform(dafnyValue); + ExecuteStatementOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformInput dafnyValue = + ToDafny.ExecuteStatementOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteStatementOutputTransformOutput, + Error + > result = this._impl.ExecuteStatementOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -187,9 +247,14 @@ public ExecuteStatementOutputTransformOutput ExecuteStatementOutputTransform( } public ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransform( - ExecuteTransactionInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue = ToDafny.ExecuteTransactionInputTransformInput(input); - Result result = this._impl.ExecuteTransactionInputTransform(dafnyValue); + ExecuteTransactionInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformInput dafnyValue = + ToDafny.ExecuteTransactionInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionInputTransformOutput, + Error + > result = this._impl.ExecuteTransactionInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -197,63 +262,106 @@ public ExecuteTransactionInputTransformOutput ExecuteTransactionInputTransform( } public ExecuteTransactionOutputTransformOutput ExecuteTransactionOutputTransform( - ExecuteTransactionOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue = ToDafny.ExecuteTransactionOutputTransformInput(input); - Result result = this._impl.ExecuteTransactionOutputTransform(dafnyValue); + ExecuteTransactionOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformInput dafnyValue = + ToDafny.ExecuteTransactionOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ExecuteTransactionOutputTransformOutput, + Error + > result = this._impl.ExecuteTransactionOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.ExecuteTransactionOutputTransformOutput(result.dtor_value()); + return ToNative.ExecuteTransactionOutputTransformOutput( + result.dtor_value() + ); } - public GetItemInputTransformOutput GetItemInputTransform(GetItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue = ToDafny.GetItemInputTransformInput(input); - Result result = this._impl.GetItemInputTransform(dafnyValue); + public GetItemInputTransformOutput GetItemInputTransform( + GetItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformInput dafnyValue = + ToDafny.GetItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemInputTransformOutput, + Error + > result = this._impl.GetItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.GetItemInputTransformOutput(result.dtor_value()); } - public GetItemOutputTransformOutput GetItemOutputTransform(GetItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue = ToDafny.GetItemOutputTransformInput(input); - Result result = this._impl.GetItemOutputTransform(dafnyValue); + public GetItemOutputTransformOutput GetItemOutputTransform( + GetItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformInput dafnyValue = + ToDafny.GetItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.GetItemOutputTransformOutput, + Error + > result = this._impl.GetItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.GetItemOutputTransformOutput(result.dtor_value()); } - public PutItemInputTransformOutput PutItemInputTransform(PutItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue = ToDafny.PutItemInputTransformInput(input); - Result result = this._impl.PutItemInputTransform(dafnyValue); + public PutItemInputTransformOutput PutItemInputTransform( + PutItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformInput dafnyValue = + ToDafny.PutItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemInputTransformOutput, + Error + > result = this._impl.PutItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.PutItemInputTransformOutput(result.dtor_value()); } - public PutItemOutputTransformOutput PutItemOutputTransform(PutItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue = ToDafny.PutItemOutputTransformInput(input); - Result result = this._impl.PutItemOutputTransform(dafnyValue); + public PutItemOutputTransformOutput PutItemOutputTransform( + PutItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformInput dafnyValue = + ToDafny.PutItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.PutItemOutputTransformOutput, + Error + > result = this._impl.PutItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.PutItemOutputTransformOutput(result.dtor_value()); } - public QueryInputTransformOutput QueryInputTransform(QueryInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue = ToDafny.QueryInputTransformInput(input); - Result result = this._impl.QueryInputTransform(dafnyValue); + public QueryInputTransformOutput QueryInputTransform( + QueryInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformInput dafnyValue = + ToDafny.QueryInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryInputTransformOutput, + Error + > result = this._impl.QueryInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.QueryInputTransformOutput(result.dtor_value()); } - public QueryOutputTransformOutput QueryOutputTransform(QueryOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue = ToDafny.QueryOutputTransformInput(input); - Result result = this._impl.QueryOutputTransform(dafnyValue); + public QueryOutputTransformOutput QueryOutputTransform( + QueryOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformInput dafnyValue = + ToDafny.QueryOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.QueryOutputTransformOutput, + Error + > result = this._impl.QueryOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -264,27 +372,45 @@ public QueryOutputTransformOutput QueryOutputTransform(QueryOutputTransformInput * Given an Item, show the intermediate values (e.g. compound beacons, virtual fields). * */ - public ResolveAttributesOutput ResolveAttributes(ResolveAttributesInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue = ToDafny.ResolveAttributesInput(input); - Result result = this._impl.ResolveAttributes(dafnyValue); + public ResolveAttributesOutput ResolveAttributes( + ResolveAttributesInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesInput dafnyValue = + ToDafny.ResolveAttributesInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ResolveAttributesOutput, + Error + > result = this._impl.ResolveAttributes(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.ResolveAttributesOutput(result.dtor_value()); } - public ScanInputTransformOutput ScanInputTransform(ScanInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue = ToDafny.ScanInputTransformInput(input); - Result result = this._impl.ScanInputTransform(dafnyValue); + public ScanInputTransformOutput ScanInputTransform( + ScanInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformInput dafnyValue = + ToDafny.ScanInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanInputTransformOutput, + Error + > result = this._impl.ScanInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } return ToNative.ScanInputTransformOutput(result.dtor_value()); } - public ScanOutputTransformOutput ScanOutputTransform(ScanOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue = ToDafny.ScanOutputTransformInput(input); - Result result = this._impl.ScanOutputTransform(dafnyValue); + public ScanOutputTransformOutput ScanOutputTransform( + ScanOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformInput dafnyValue = + ToDafny.ScanOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.ScanOutputTransformOutput, + Error + > result = this._impl.ScanOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -292,9 +418,14 @@ public ScanOutputTransformOutput ScanOutputTransform(ScanOutputTransformInput in } public TransactGetItemsInputTransformOutput TransactGetItemsInputTransform( - TransactGetItemsInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue = ToDafny.TransactGetItemsInputTransformInput(input); - Result result = this._impl.TransactGetItemsInputTransform(dafnyValue); + TransactGetItemsInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformInput dafnyValue = + ToDafny.TransactGetItemsInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsInputTransformOutput, + Error + > result = this._impl.TransactGetItemsInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -302,9 +433,14 @@ public TransactGetItemsInputTransformOutput TransactGetItemsInputTransform( } public TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransform( - TransactGetItemsOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue = ToDafny.TransactGetItemsOutputTransformInput(input); - Result result = this._impl.TransactGetItemsOutputTransform(dafnyValue); + TransactGetItemsOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformInput dafnyValue = + ToDafny.TransactGetItemsOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactGetItemsOutputTransformOutput, + Error + > result = this._impl.TransactGetItemsOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -312,9 +448,14 @@ public TransactGetItemsOutputTransformOutput TransactGetItemsOutputTransform( } public TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransform( - TransactWriteItemsInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue = ToDafny.TransactWriteItemsInputTransformInput(input); - Result result = this._impl.TransactWriteItemsInputTransform(dafnyValue); + TransactWriteItemsInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformInput dafnyValue = + ToDafny.TransactWriteItemsInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsInputTransformOutput, + Error + > result = this._impl.TransactWriteItemsInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -322,19 +463,31 @@ public TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransform( } public TransactWriteItemsOutputTransformOutput TransactWriteItemsOutputTransform( - TransactWriteItemsOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue = ToDafny.TransactWriteItemsOutputTransformInput(input); - Result result = this._impl.TransactWriteItemsOutputTransform(dafnyValue); + TransactWriteItemsOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformInput dafnyValue = + ToDafny.TransactWriteItemsOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.TransactWriteItemsOutputTransformOutput, + Error + > result = this._impl.TransactWriteItemsOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } - return ToNative.TransactWriteItemsOutputTransformOutput(result.dtor_value()); + return ToNative.TransactWriteItemsOutputTransformOutput( + result.dtor_value() + ); } public UpdateItemInputTransformOutput UpdateItemInputTransform( - UpdateItemInputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue = ToDafny.UpdateItemInputTransformInput(input); - Result result = this._impl.UpdateItemInputTransform(dafnyValue); + UpdateItemInputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformInput dafnyValue = + ToDafny.UpdateItemInputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemInputTransformOutput, + Error + > result = this._impl.UpdateItemInputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -342,9 +495,14 @@ public UpdateItemInputTransformOutput UpdateItemInputTransform( } public UpdateItemOutputTransformOutput UpdateItemOutputTransform( - UpdateItemOutputTransformInput input) { - software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue = ToDafny.UpdateItemOutputTransformInput(input); - Result result = this._impl.UpdateItemOutputTransform(dafnyValue); + UpdateItemOutputTransformInput input + ) { + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformInput dafnyValue = + ToDafny.UpdateItemOutputTransformInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.UpdateItemOutputTransformOutput, + Error + > result = this._impl.UpdateItemOutputTransform(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -360,7 +518,8 @@ public interface Builder { * @param DynamoDbTablesEncryptionConfig The configuration for client-side encryption with multiple DynamoDB table. */ Builder DynamoDbTablesEncryptionConfig( - DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig); + DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig + ); /** * @return The configuration for client-side encryption with multiple DynamoDB table. @@ -371,13 +530,14 @@ Builder DynamoDbTablesEncryptionConfig( } static class BuilderImpl implements Builder { + protected DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder DynamoDbTablesEncryptionConfig( - DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig) { + DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig + ) { this.DynamoDbTablesEncryptionConfig = DynamoDbTablesEncryptionConfig; return this; } @@ -387,8 +547,10 @@ public DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig() { } public DynamoDbEncryptionTransforms build() { - if (Objects.isNull(this.DynamoDbTablesEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `DynamoDbTablesEncryptionConfig`"); + if (Objects.isNull(this.DynamoDbTablesEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `DynamoDbTablesEncryptionConfig`" + ); } return new DynamoDbEncryptionTransforms(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java index d242a3a4e..5e0d1a9d7 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/StructuredEncryption.java @@ -16,12 +16,15 @@ import software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig; public class StructuredEncryption { + private final IStructuredEncryptionClient _impl; protected StructuredEncryption(BuilderImpl builder) { StructuredEncryptionConfig input = builder.StructuredEncryptionConfig(); - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue = ToDafny.StructuredEncryptionConfig(input); - Result result = __default.StructuredEncryption(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue = + ToDafny.StructuredEncryptionConfig(input); + Result result = + __default.StructuredEncryption(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -37,8 +40,12 @@ public static Builder builder() { } public DecryptStructureOutput DecryptStructure(DecryptStructureInput input) { - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue = ToDafny.DecryptStructureInput(input); - Result result = this._impl.DecryptStructure(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue = + ToDafny.DecryptStructureInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput, + Error + > result = this._impl.DecryptStructure(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -46,8 +53,12 @@ public DecryptStructureOutput DecryptStructure(DecryptStructureInput input) { } public EncryptStructureOutput EncryptStructure(EncryptStructureInput input) { - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue = ToDafny.EncryptStructureInput(input); - Result result = this._impl.EncryptStructure(dafnyValue); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue = + ToDafny.EncryptStructureInput(input); + Result< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput, + Error + > result = this._impl.EncryptStructure(dafnyValue); if (result.is_Failure()) { throw ToNative.Error(result.dtor_error()); } @@ -59,7 +70,9 @@ protected IStructuredEncryptionClient impl() { } public interface Builder { - Builder StructuredEncryptionConfig(StructuredEncryptionConfig StructuredEncryptionConfig); + Builder StructuredEncryptionConfig( + StructuredEncryptionConfig StructuredEncryptionConfig + ); StructuredEncryptionConfig StructuredEncryptionConfig(); @@ -67,13 +80,14 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected StructuredEncryptionConfig StructuredEncryptionConfig; - protected BuilderImpl() { - } + protected BuilderImpl() {} public Builder StructuredEncryptionConfig( - StructuredEncryptionConfig StructuredEncryptionConfig) { + StructuredEncryptionConfig StructuredEncryptionConfig + ) { this.StructuredEncryptionConfig = StructuredEncryptionConfig; return this; } @@ -83,8 +97,10 @@ public StructuredEncryptionConfig StructuredEncryptionConfig() { } public StructuredEncryption build() { - if (Objects.isNull(this.StructuredEncryptionConfig())) { - throw new IllegalArgumentException("Missing value for required field `StructuredEncryptionConfig`"); + if (Objects.isNull(this.StructuredEncryptionConfig())) { + throw new IllegalArgumentException( + "Missing value for required field `StructuredEncryptionConfig`" + ); } return new StructuredEncryption(this); } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java index c60cfb420..983c37717 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToDafny.java @@ -40,6 +40,7 @@ import software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager; public class ToDafny { + public static Error Error(RuntimeException nativeValue) { if (nativeValue instanceof StructuredEncryptionException) { return ToDafny.Error((StructuredEncryptionException) nativeValue); @@ -58,289 +59,536 @@ public static Error Error(OpaqueError nativeValue) { } public static Error Error(CollectionOfErrors nativeValue) { - DafnySequence list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue.list(), - ToDafny::Error, - Error._typeDescriptor()); - DafnySequence message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()); + DafnySequence list = + software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue.list(), + ToDafny::Error, + Error._typeDescriptor() + ); + DafnySequence message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.getMessage() + ); return Error.create_CollectionOfErrors(list, message); } public static AuthenticateSchema AuthenticateSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema nativeValue + ) { AuthenticateSchemaContent content; content = ToDafny.AuthenticateSchemaContent(nativeValue.content()); - Option, ? extends AuthenticateAction>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.AuthenticateSchemaAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.AuthenticateSchemaAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new AuthenticateSchema(content, attributes); } public static CryptoSchema CryptoSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema nativeValue + ) { CryptoSchemaContent content; content = ToDafny.CryptoSchemaContent(nativeValue.content()); - Option, ? extends AuthenticateAction>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.CryptoSchemaAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.CryptoSchemaAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new CryptoSchema(content, attributes); } public static DecryptStructureInput DecryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureInput nativeValue + ) { DafnySequence tableName; - tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()); + tableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.tableName() + ); StructuredData encryptedStructure; - encryptedStructure = ToDafny.StructuredData(nativeValue.encryptedStructure()); + encryptedStructure = + ToDafny.StructuredData(nativeValue.encryptedStructure()); AuthenticateSchema authenticateSchema; - authenticateSchema = ToDafny.AuthenticateSchema(nativeValue.authenticateSchema()); + authenticateSchema = + ToDafny.AuthenticateSchema(nativeValue.authenticateSchema()); ICryptographicMaterialsManager cmm; - cmm = software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm()); - Option, ? extends DafnySequence>> encryptionContext; - encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext())) + cmm = + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ); + Option< + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > + > encryptionContext; + encryptionContext = + (Objects.nonNull(nativeValue.encryptionContext()) && + nativeValue.encryptionContext().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ) + ) : Option.create_None(); - return new DecryptStructureInput(tableName, encryptedStructure, authenticateSchema, cmm, encryptionContext); + return new DecryptStructureInput( + tableName, + encryptedStructure, + authenticateSchema, + cmm, + encryptionContext + ); } public static DecryptStructureOutput DecryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.DecryptStructureOutput nativeValue + ) { StructuredData plaintextStructure; - plaintextStructure = ToDafny.StructuredData(nativeValue.plaintextStructure()); + plaintextStructure = + ToDafny.StructuredData(nativeValue.plaintextStructure()); ParsedHeader parsedHeader; parsedHeader = ToDafny.ParsedHeader(nativeValue.parsedHeader()); return new DecryptStructureOutput(plaintextStructure, parsedHeader); } public static EncryptStructureInput EncryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureInput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureInput nativeValue + ) { DafnySequence tableName; - tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()); + tableName = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.tableName() + ); StructuredData plaintextStructure; - plaintextStructure = ToDafny.StructuredData(nativeValue.plaintextStructure()); + plaintextStructure = + ToDafny.StructuredData(nativeValue.plaintextStructure()); CryptoSchema cryptoSchema; cryptoSchema = ToDafny.CryptoSchema(nativeValue.cryptoSchema()); ICryptographicMaterialsManager cmm; - cmm = software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(nativeValue.cmm()); + cmm = + software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager( + nativeValue.cmm() + ); Option algorithmSuiteId; - algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId())) + algorithmSuiteId = + Objects.nonNull(nativeValue.algorithmSuiteId()) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ) + ) : Option.create_None(); - Option, ? extends DafnySequence>> encryptionContext; - encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ? - Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > + > encryptionContext; + encryptionContext = + (Objects.nonNull(nativeValue.encryptionContext()) && + nativeValue.encryptionContext().size() > 0) + ? Option.create_Some( + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ) + ) : Option.create_None(); - return new EncryptStructureInput(tableName, plaintextStructure, cryptoSchema, cmm, algorithmSuiteId, encryptionContext); + return new EncryptStructureInput( + tableName, + plaintextStructure, + cryptoSchema, + cmm, + algorithmSuiteId, + encryptionContext + ); } public static EncryptStructureOutput EncryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureOutput nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.EncryptStructureOutput nativeValue + ) { StructuredData encryptedStructure; - encryptedStructure = ToDafny.StructuredData(nativeValue.encryptedStructure()); + encryptedStructure = + ToDafny.StructuredData(nativeValue.encryptedStructure()); ParsedHeader parsedHeader; parsedHeader = ToDafny.ParsedHeader(nativeValue.parsedHeader()); return new EncryptStructureOutput(encryptedStructure, parsedHeader); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.ParsedHeader nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.ParsedHeader nativeValue + ) { CryptoSchema cryptoSchema; cryptoSchema = ToDafny.CryptoSchema(nativeValue.cryptoSchema()); DBEAlgorithmSuiteId algorithmSuiteId; - algorithmSuiteId = software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(nativeValue.algorithmSuiteId()); + algorithmSuiteId = + software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId( + nativeValue.algorithmSuiteId() + ); DafnySequence encryptedDataKeys; - encryptedDataKeys = software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys()); - DafnyMap, ? extends DafnySequence> storedEncryptionContext; - storedEncryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.storedEncryptionContext()); - DafnyMap, ? extends DafnySequence> encryptionContext; - encryptionContext = software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext(nativeValue.encryptionContext()); - return new ParsedHeader(cryptoSchema, algorithmSuiteId, encryptedDataKeys, storedEncryptionContext, encryptionContext); + encryptedDataKeys = + software.amazon.cryptography.materialproviders.ToDafny.EncryptedDataKeyList( + nativeValue.encryptedDataKeys() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > storedEncryptionContext; + storedEncryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.storedEncryptionContext() + ); + DafnyMap< + ? extends DafnySequence, + ? extends DafnySequence + > encryptionContext; + encryptionContext = + software.amazon.cryptography.materialproviders.ToDafny.EncryptionContext( + nativeValue.encryptionContext() + ); + return new ParsedHeader( + cryptoSchema, + algorithmSuiteId, + encryptedDataKeys, + storedEncryptionContext, + encryptionContext + ); } public static StructuredData StructuredData( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData nativeValue + ) { StructuredDataContent content; content = ToDafny.StructuredDataContent(nativeValue.content()); - Option, ? extends StructuredDataTerminal>> attributes; - attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ? - Option.create_Some(ToDafny.StructuredDataAttributes(nativeValue.attributes())) + Option< + DafnyMap< + ? extends DafnySequence, + ? extends StructuredDataTerminal + > + > attributes; + attributes = + (Objects.nonNull(nativeValue.attributes()) && + nativeValue.attributes().size() > 0) + ? Option.create_Some( + ToDafny.StructuredDataAttributes(nativeValue.attributes()) + ) : Option.create_None(); return new StructuredData(content, attributes); } public static StructuredDataTerminal StructuredDataTerminal( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal nativeValue + ) { DafnySequence value; - value = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.value()); + value = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence( + nativeValue.value() + ); DafnySequence typeId; - typeId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.typeId()); + typeId = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence( + nativeValue.typeId() + ); return new StructuredDataTerminal(value, typeId); } public static StructuredEncryptionConfig StructuredEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionConfig nativeValue + ) { return new StructuredEncryptionConfig(); } public static Error Error(StructuredEncryptionException nativeValue) { DafnySequence message; - message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()); + message = + software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence( + nativeValue.message() + ); return new Error_StructuredEncryptionException(message); } public static AuthenticateAction AuthenticateAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction nativeValue + ) { switch (nativeValue) { - case SIGN: { - return AuthenticateAction.create_SIGN(); - } - case DO_NOT_SIGN: { - return AuthenticateAction.create_DO__NOT__SIGN(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction."); - } + case SIGN: + { + return AuthenticateAction.create_SIGN(); + } + case DO_NOT_SIGN: + { + return AuthenticateAction.create_DO__NOT__SIGN(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction." + ); + } } } public static CryptoAction CryptoAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction nativeValue + ) { switch (nativeValue) { - case ENCRYPT_AND_SIGN: { - return CryptoAction.create_ENCRYPT__AND__SIGN(); - } - case SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT: { - return CryptoAction.create_SIGN__AND__INCLUDE__IN__ENCRYPTION__CONTEXT(); - } - case SIGN_ONLY: { - return CryptoAction.create_SIGN__ONLY(); - } - case DO_NOTHING: { - return CryptoAction.create_DO__NOTHING(); - } - default: { - throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction."); - } + case ENCRYPT_AND_SIGN: + { + return CryptoAction.create_ENCRYPT__AND__SIGN(); + } + case SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT: + { + return CryptoAction.create_SIGN__AND__INCLUDE__IN__ENCRYPTION__CONTEXT(); + } + case SIGN_ONLY: + { + return CryptoAction.create_SIGN__ONLY(); + } + case DO_NOTHING: + { + return CryptoAction.create_DO__NOTHING(); + } + default: + { + throw new RuntimeException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction." + ); + } } } public static AuthenticateSchemaContent AuthenticateSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchemaContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchemaContent nativeValue + ) { if (Objects.nonNull(nativeValue.Action())) { - return AuthenticateSchemaContent.create_Action(ToDafny.AuthenticateAction(nativeValue.Action())); + return AuthenticateSchemaContent.create_Action( + ToDafny.AuthenticateAction(nativeValue.Action()) + ); } if (Objects.nonNull(nativeValue.SchemaMap())) { - return AuthenticateSchemaContent.create_SchemaMap(ToDafny.AuthenticateSchemaMap(nativeValue.SchemaMap())); + return AuthenticateSchemaContent.create_SchemaMap( + ToDafny.AuthenticateSchemaMap(nativeValue.SchemaMap()) + ); } if (Objects.nonNull(nativeValue.SchemaList())) { - return AuthenticateSchemaContent.create_SchemaList(ToDafny.AuthenticateSchemaList(nativeValue.SchemaList())); + return AuthenticateSchemaContent.create_SchemaList( + ToDafny.AuthenticateSchemaList(nativeValue.SchemaList()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent." + ); } public static CryptoSchemaContent CryptoSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchemaContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchemaContent nativeValue + ) { if (Objects.nonNull(nativeValue.Action())) { - return CryptoSchemaContent.create_Action(ToDafny.CryptoAction(nativeValue.Action())); + return CryptoSchemaContent.create_Action( + ToDafny.CryptoAction(nativeValue.Action()) + ); } if (Objects.nonNull(nativeValue.SchemaMap())) { - return CryptoSchemaContent.create_SchemaMap(ToDafny.CryptoSchemaMap(nativeValue.SchemaMap())); + return CryptoSchemaContent.create_SchemaMap( + ToDafny.CryptoSchemaMap(nativeValue.SchemaMap()) + ); } if (Objects.nonNull(nativeValue.SchemaList())) { - return CryptoSchemaContent.create_SchemaList(ToDafny.CryptoSchemaList(nativeValue.SchemaList())); + return CryptoSchemaContent.create_SchemaList( + ToDafny.CryptoSchemaList(nativeValue.SchemaList()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent." + ); } public static StructuredDataContent StructuredDataContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataContent nativeValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataContent nativeValue + ) { if (Objects.nonNull(nativeValue.Terminal())) { - return StructuredDataContent.create_Terminal(ToDafny.StructuredDataTerminal(nativeValue.Terminal())); + return StructuredDataContent.create_Terminal( + ToDafny.StructuredDataTerminal(nativeValue.Terminal()) + ); } if (Objects.nonNull(nativeValue.DataList())) { - return StructuredDataContent.create_DataList(ToDafny.StructuredDataList(nativeValue.DataList())); + return StructuredDataContent.create_DataList( + ToDafny.StructuredDataList(nativeValue.DataList()) + ); } if (Objects.nonNull(nativeValue.DataMap())) { - return StructuredDataContent.create_DataMap(ToDafny.StructuredDataMap(nativeValue.DataMap())); + return StructuredDataContent.create_DataMap( + ToDafny.StructuredDataMap(nativeValue.DataMap()) + ); } - throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent."); + throw new IllegalArgumentException( + "Cannot convert " + + nativeValue + + " to software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent." + ); } - public static DafnySequence AuthenticateSchemaList( - List nativeValue) { + public static DafnySequence< + ? extends AuthenticateSchema + > AuthenticateSchemaList( + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema, - AuthenticateSchema._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema, + AuthenticateSchema._typeDescriptor() + ); } public static DafnySequence CryptoSchemaList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema, - CryptoSchema._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema, + CryptoSchema._typeDescriptor() + ); } public static DafnySequence StructuredDataList( - List nativeValue) { + List< + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence( - nativeValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData, - StructuredData._typeDescriptor()); + nativeValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData, + StructuredData._typeDescriptor() + ); } - public static DafnyMap, ? extends AuthenticateAction> AuthenticateSchemaAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > AuthenticateSchemaAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction + ); } - public static DafnyMap, ? extends AuthenticateSchema> AuthenticateSchemaMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateSchema + > AuthenticateSchemaMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateSchema + ); } - public static DafnyMap, ? extends AuthenticateAction> CryptoSchemaAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends AuthenticateAction + > CryptoSchemaAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::AuthenticateAction + ); } - public static DafnyMap, ? extends CryptoSchema> CryptoSchemaMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends CryptoSchema + > CryptoSchemaMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoSchema + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::CryptoSchema + ); } - public static DafnyMap, ? extends StructuredDataTerminal> StructuredDataAttributes( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends StructuredDataTerminal + > StructuredDataAttributes( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredDataTerminal + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredDataTerminal); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredDataTerminal + ); } - public static DafnyMap, ? extends StructuredData> StructuredDataMap( - Map nativeValue) { + public static DafnyMap< + ? extends DafnySequence, + ? extends StructuredData + > StructuredDataMap( + Map< + String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredData + > nativeValue + ) { return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap( - nativeValue, - software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData); + nativeValue, + software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny::StructuredData + ); } - public static IStructuredEncryptionClient StructuredEncryption(StructuredEncryption nativeValue) { + public static IStructuredEncryptionClient StructuredEncryption( + StructuredEncryption nativeValue + ) { return nativeValue.impl(); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java index 97bbd90cc..205442164 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/ToNative.java @@ -36,6 +36,7 @@ import software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.StructuredEncryptionException; public class ToNative { + public static OpaqueError Error(Error_Opaque dafnyValue) { OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue.dtor_obj()); @@ -45,17 +46,29 @@ public static OpaqueError Error(Error_Opaque dafnyValue) { public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) { CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder(); nativeBuilder.list( - software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue.dtor_list(), - ToNative::Error)); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue.dtor_list(), + ToNative::Error + ) + ); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } public static StructuredEncryptionException Error( - Error_StructuredEncryptionException dafnyValue) { - StructuredEncryptionException.Builder nativeBuilder = StructuredEncryptionException.builder(); - nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message())); + Error_StructuredEncryptionException dafnyValue + ) { + StructuredEncryptionException.Builder nativeBuilder = + StructuredEncryptionException.builder(); + nativeBuilder.message( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_message() + ) + ); return nativeBuilder.build(); } @@ -70,10 +83,14 @@ public static RuntimeException Error(Error dafnyValue) { return ToNative.Error((Error_CollectionOfErrors) dafnyValue); } if (dafnyValue.is_AwsCryptographyPrimitives()) { - return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives()); + return software.amazon.cryptography.primitives.ToNative.Error( + dafnyValue.dtor_AwsCryptographyPrimitives() + ); } if (dafnyValue.is_AwsCryptographyMaterialProviders()) { - return software.amazon.cryptography.materialproviders.ToNative.Error(dafnyValue.dtor_AwsCryptographyMaterialProviders()); + return software.amazon.cryptography.materialproviders.ToNative.Error( + dafnyValue.dtor_AwsCryptographyMaterialProviders() + ); } OpaqueError.Builder nativeBuilder = OpaqueError.builder(); nativeBuilder.obj(dafnyValue); @@ -81,118 +98,227 @@ public static RuntimeException Error(Error dafnyValue) { } public static AuthenticateSchema AuthenticateSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema dafnyValue + ) { AuthenticateSchema.Builder nativeBuilder = AuthenticateSchema.builder(); - nativeBuilder.content(ToNative.AuthenticateSchemaContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.AuthenticateSchemaContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.AuthenticateSchemaAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.AuthenticateSchemaAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static CryptoSchema CryptoSchema( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema dafnyValue + ) { CryptoSchema.Builder nativeBuilder = CryptoSchema.builder(); - nativeBuilder.content(ToNative.CryptoSchemaContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.CryptoSchemaContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.CryptoSchemaAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.CryptoSchemaAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static DecryptStructureInput DecryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue) { - DecryptStructureInput.Builder nativeBuilder = DecryptStructureInput.builder(); - nativeBuilder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_tableName())); - nativeBuilder.encryptedStructure(ToNative.StructuredData(dafnyValue.dtor_encryptedStructure())); - nativeBuilder.authenticateSchema(ToNative.AuthenticateSchema(dafnyValue.dtor_authenticateSchema())); - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureInput dafnyValue + ) { + DecryptStructureInput.Builder nativeBuilder = + DecryptStructureInput.builder(); + nativeBuilder.tableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_tableName() + ) + ); + nativeBuilder.encryptedStructure( + ToNative.StructuredData(dafnyValue.dtor_encryptedStructure()) + ); + nativeBuilder.authenticateSchema( + ToNative.AuthenticateSchema(dafnyValue.dtor_authenticateSchema()) + ); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm() + ) + ); if (dafnyValue.dtor_encryptionContext().is_Some()) { - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext().dtor_value())); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext().dtor_value() + ) + ); } return nativeBuilder.build(); } public static DecryptStructureOutput DecryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput dafnyValue) { - DecryptStructureOutput.Builder nativeBuilder = DecryptStructureOutput.builder(); - nativeBuilder.plaintextStructure(ToNative.StructuredData(dafnyValue.dtor_plaintextStructure())); - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.DecryptStructureOutput dafnyValue + ) { + DecryptStructureOutput.Builder nativeBuilder = + DecryptStructureOutput.builder(); + nativeBuilder.plaintextStructure( + ToNative.StructuredData(dafnyValue.dtor_plaintextStructure()) + ); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader()) + ); return nativeBuilder.build(); } public static EncryptStructureInput EncryptStructureInput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue) { - EncryptStructureInput.Builder nativeBuilder = EncryptStructureInput.builder(); - nativeBuilder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_tableName())); - nativeBuilder.plaintextStructure(ToNative.StructuredData(dafnyValue.dtor_plaintextStructure())); - nativeBuilder.cryptoSchema(ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema())); - nativeBuilder.cmm(software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager(dafnyValue.dtor_cmm())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureInput dafnyValue + ) { + EncryptStructureInput.Builder nativeBuilder = + EncryptStructureInput.builder(); + nativeBuilder.tableName( + software.amazon.smithy.dafny.conversion.ToNative.Simple.String( + dafnyValue.dtor_tableName() + ) + ); + nativeBuilder.plaintextStructure( + ToNative.StructuredData(dafnyValue.dtor_plaintextStructure()) + ); + nativeBuilder.cryptoSchema( + ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema()) + ); + nativeBuilder.cmm( + software.amazon.cryptography.materialproviders.ToNative.CryptographicMaterialsManager( + dafnyValue.dtor_cmm() + ) + ); if (dafnyValue.dtor_algorithmSuiteId().is_Some()) { - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value())); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId().dtor_value() + ) + ); } if (dafnyValue.dtor_encryptionContext().is_Some()) { - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext().dtor_value())); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext().dtor_value() + ) + ); } return nativeBuilder.build(); } public static EncryptStructureOutput EncryptStructureOutput( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput dafnyValue) { - EncryptStructureOutput.Builder nativeBuilder = EncryptStructureOutput.builder(); - nativeBuilder.encryptedStructure(ToNative.StructuredData(dafnyValue.dtor_encryptedStructure())); - nativeBuilder.parsedHeader(ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.EncryptStructureOutput dafnyValue + ) { + EncryptStructureOutput.Builder nativeBuilder = + EncryptStructureOutput.builder(); + nativeBuilder.encryptedStructure( + ToNative.StructuredData(dafnyValue.dtor_encryptedStructure()) + ); + nativeBuilder.parsedHeader( + ToNative.ParsedHeader(dafnyValue.dtor_parsedHeader()) + ); return nativeBuilder.build(); } public static ParsedHeader ParsedHeader( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.ParsedHeader dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.ParsedHeader dafnyValue + ) { ParsedHeader.Builder nativeBuilder = ParsedHeader.builder(); - nativeBuilder.cryptoSchema(ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema())); - nativeBuilder.algorithmSuiteId(software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId())); - nativeBuilder.encryptedDataKeys(software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys())); - nativeBuilder.storedEncryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_storedEncryptionContext())); - nativeBuilder.encryptionContext(software.amazon.cryptography.materialproviders.ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext())); + nativeBuilder.cryptoSchema( + ToNative.CryptoSchema(dafnyValue.dtor_cryptoSchema()) + ); + nativeBuilder.algorithmSuiteId( + software.amazon.cryptography.materialproviders.ToNative.DBEAlgorithmSuiteId( + dafnyValue.dtor_algorithmSuiteId() + ) + ); + nativeBuilder.encryptedDataKeys( + software.amazon.cryptography.materialproviders.ToNative.EncryptedDataKeyList( + dafnyValue.dtor_encryptedDataKeys() + ) + ); + nativeBuilder.storedEncryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_storedEncryptionContext() + ) + ); + nativeBuilder.encryptionContext( + software.amazon.cryptography.materialproviders.ToNative.EncryptionContext( + dafnyValue.dtor_encryptionContext() + ) + ); return nativeBuilder.build(); } public static StructuredData StructuredData( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData dafnyValue + ) { StructuredData.Builder nativeBuilder = StructuredData.builder(); - nativeBuilder.content(ToNative.StructuredDataContent(dafnyValue.dtor_content())); + nativeBuilder.content( + ToNative.StructuredDataContent(dafnyValue.dtor_content()) + ); if (dafnyValue.dtor_attributes().is_Some()) { - nativeBuilder.attributes(ToNative.StructuredDataAttributes(dafnyValue.dtor_attributes().dtor_value())); + nativeBuilder.attributes( + ToNative.StructuredDataAttributes( + dafnyValue.dtor_attributes().dtor_value() + ) + ); } return nativeBuilder.build(); } public static StructuredDataTerminal StructuredDataTerminal( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal dafnyValue) { - StructuredDataTerminal.Builder nativeBuilder = StructuredDataTerminal.builder(); - nativeBuilder.value(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_value())); - nativeBuilder.typeId(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_typeId())); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal dafnyValue + ) { + StructuredDataTerminal.Builder nativeBuilder = + StructuredDataTerminal.builder(); + nativeBuilder.value( + software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer( + dafnyValue.dtor_value() + ) + ); + nativeBuilder.typeId( + software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer( + dafnyValue.dtor_typeId() + ) + ); return nativeBuilder.build(); } public static StructuredEncryptionConfig StructuredEncryptionConfig( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue) { - StructuredEncryptionConfig.Builder nativeBuilder = StructuredEncryptionConfig.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredEncryptionConfig dafnyValue + ) { + StructuredEncryptionConfig.Builder nativeBuilder = + StructuredEncryptionConfig.builder(); return nativeBuilder.build(); } public static AuthenticateAction AuthenticateAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction dafnyValue + ) { if (dafnyValue.is_SIGN()) { return AuthenticateAction.SIGN; } if (dafnyValue.is_DO__NOT__SIGN()) { return AuthenticateAction.DO_NOT_SIGN; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.AuthenticateAction matches the input : " + + dafnyValue + ); } public static CryptoAction CryptoAction( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoAction dafnyValue + ) { if (dafnyValue.is_ENCRYPT__AND__SIGN()) { return CryptoAction.ENCRYPT_AND_SIGN; } @@ -205,124 +331,192 @@ public static CryptoAction CryptoAction( if (dafnyValue.is_DO__NOTHING()) { return CryptoAction.DO_NOTHING; } - throw new IllegalArgumentException("No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction matches the input : " + dafnyValue); + throw new IllegalArgumentException( + "No entry of software.amazon.cryptography.dbencryptionsdk.structuredencryption.model.CryptoAction matches the input : " + + dafnyValue + ); } public static AuthenticateSchemaContent AuthenticateSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent dafnyValue) { - AuthenticateSchemaContent.Builder nativeBuilder = AuthenticateSchemaContent.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchemaContent dafnyValue + ) { + AuthenticateSchemaContent.Builder nativeBuilder = + AuthenticateSchemaContent.builder(); if (dafnyValue.is_Action()) { - nativeBuilder.Action(ToNative.AuthenticateAction(dafnyValue.dtor_Action())); + nativeBuilder.Action( + ToNative.AuthenticateAction(dafnyValue.dtor_Action()) + ); } if (dafnyValue.is_SchemaMap()) { - nativeBuilder.SchemaMap(ToNative.AuthenticateSchemaMap(dafnyValue.dtor_SchemaMap())); + nativeBuilder.SchemaMap( + ToNative.AuthenticateSchemaMap(dafnyValue.dtor_SchemaMap()) + ); } if (dafnyValue.is_SchemaList()) { - nativeBuilder.SchemaList(ToNative.AuthenticateSchemaList(dafnyValue.dtor_SchemaList())); + nativeBuilder.SchemaList( + ToNative.AuthenticateSchemaList(dafnyValue.dtor_SchemaList()) + ); } return nativeBuilder.build(); } public static CryptoSchemaContent CryptoSchemaContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent dafnyValue) { + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchemaContent dafnyValue + ) { CryptoSchemaContent.Builder nativeBuilder = CryptoSchemaContent.builder(); if (dafnyValue.is_Action()) { nativeBuilder.Action(ToNative.CryptoAction(dafnyValue.dtor_Action())); } if (dafnyValue.is_SchemaMap()) { - nativeBuilder.SchemaMap(ToNative.CryptoSchemaMap(dafnyValue.dtor_SchemaMap())); + nativeBuilder.SchemaMap( + ToNative.CryptoSchemaMap(dafnyValue.dtor_SchemaMap()) + ); } if (dafnyValue.is_SchemaList()) { - nativeBuilder.SchemaList(ToNative.CryptoSchemaList(dafnyValue.dtor_SchemaList())); + nativeBuilder.SchemaList( + ToNative.CryptoSchemaList(dafnyValue.dtor_SchemaList()) + ); } return nativeBuilder.build(); } public static StructuredDataContent StructuredDataContent( - software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent dafnyValue) { - StructuredDataContent.Builder nativeBuilder = StructuredDataContent.builder(); + software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataContent dafnyValue + ) { + StructuredDataContent.Builder nativeBuilder = + StructuredDataContent.builder(); if (dafnyValue.is_Terminal()) { - nativeBuilder.Terminal(ToNative.StructuredDataTerminal(dafnyValue.dtor_Terminal())); + nativeBuilder.Terminal( + ToNative.StructuredDataTerminal(dafnyValue.dtor_Terminal()) + ); } if (dafnyValue.is_DataList()) { - nativeBuilder.DataList(ToNative.StructuredDataList(dafnyValue.dtor_DataList())); + nativeBuilder.DataList( + ToNative.StructuredDataList(dafnyValue.dtor_DataList()) + ); } if (dafnyValue.is_DataMap()) { - nativeBuilder.DataMap(ToNative.StructuredDataMap(dafnyValue.dtor_DataMap())); + nativeBuilder.DataMap( + ToNative.StructuredDataMap(dafnyValue.dtor_DataMap()) + ); } return nativeBuilder.build(); } public static List AuthenticateSchemaList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema + ); } public static List CryptoSchemaList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema + ); } public static List StructuredDataList( - DafnySequence dafnyValue) { + DafnySequence< + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList( - dafnyValue, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData); + dafnyValue, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData + ); } public static Map AuthenticateSchemaAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction + ); } public static Map AuthenticateSchemaMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateSchema + ); } public static Map CryptoSchemaAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.AuthenticateAction + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::AuthenticateAction + ); } public static Map CryptoSchemaMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.CryptoSchema + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::CryptoSchema + ); } public static Map StructuredDataAttributes( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredDataTerminal + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredDataTerminal); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredDataTerminal + ); } public static Map StructuredDataMap( - DafnyMap, ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData> dafnyValue) { + DafnyMap< + ? extends DafnySequence, + ? extends software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types.StructuredData + > dafnyValue + ) { return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap( - dafnyValue, - software.amazon.smithy.dafny.conversion.ToNative.Simple::String, - software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData); + dafnyValue, + software.amazon.smithy.dafny.conversion.ToNative.Simple::String, + software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToNative::StructuredData + ); } - public static StructuredEncryption StructuredEncryption(IStructuredEncryptionClient dafnyValue) { + public static StructuredEncryption StructuredEncryption( + IStructuredEncryptionClient dafnyValue + ) { return new StructuredEncryption(dafnyValue); } } diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoAction.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoAction.java index a62f53e33..0922c443b 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoAction.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CryptoAction.java @@ -6,7 +6,9 @@ public enum CryptoAction { ENCRYPT_AND_SIGN("ENCRYPT_AND_SIGN"), - SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT("SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT"), + SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT( + "SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT" + ), SIGN_ONLY("SIGN_ONLY"), diff --git a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java index 75167d9cf..2c806dd94 100644 --- a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java +++ b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/ParsedHeader.java @@ -10,6 +10,7 @@ import software.amazon.cryptography.materialproviders.model.EncryptedDataKey; public class ParsedHeader { + private final CryptoSchema cryptoSchema; private final DBEAlgorithmSuiteId algorithmSuiteId; @@ -69,7 +70,9 @@ public interface Builder { List encryptedDataKeys(); - Builder storedEncryptionContext(Map storedEncryptionContext); + Builder storedEncryptionContext( + Map storedEncryptionContext + ); Map storedEncryptionContext(); @@ -81,6 +84,7 @@ public interface Builder { } static class BuilderImpl implements Builder { + protected CryptoSchema cryptoSchema; protected DBEAlgorithmSuiteId algorithmSuiteId; @@ -91,8 +95,7 @@ static class BuilderImpl implements Builder { protected Map encryptionContext; - protected BuilderImpl() { - } + protected BuilderImpl() {} protected BuilderImpl(ParsedHeader model) { this.cryptoSchema = model.cryptoSchema(); @@ -129,7 +132,9 @@ public List encryptedDataKeys() { return this.encryptedDataKeys; } - public Builder storedEncryptionContext(Map storedEncryptionContext) { + public Builder storedEncryptionContext( + Map storedEncryptionContext + ) { this.storedEncryptionContext = storedEncryptionContext; return this; } @@ -148,20 +153,30 @@ public Map encryptionContext() { } public ParsedHeader build() { - if (Objects.isNull(this.cryptoSchema())) { - throw new IllegalArgumentException("Missing value for required field `cryptoSchema`"); + if (Objects.isNull(this.cryptoSchema())) { + throw new IllegalArgumentException( + "Missing value for required field `cryptoSchema`" + ); } - if (Objects.isNull(this.algorithmSuiteId())) { - throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`"); + if (Objects.isNull(this.algorithmSuiteId())) { + throw new IllegalArgumentException( + "Missing value for required field `algorithmSuiteId`" + ); } - if (Objects.isNull(this.encryptedDataKeys())) { - throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`"); + if (Objects.isNull(this.encryptedDataKeys())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptedDataKeys`" + ); } - if (Objects.isNull(this.storedEncryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `storedEncryptionContext`"); + if (Objects.isNull(this.storedEncryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `storedEncryptionContext`" + ); } - if (Objects.isNull(this.encryptionContext())) { - throw new IllegalArgumentException("Missing value for required field `encryptionContext`"); + if (Objects.isNull(this.encryptionContext())) { + throw new IllegalArgumentException( + "Missing value for required field `encryptionContext`" + ); } return new ParsedHeader(this); } diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs index 439bc499c..5c0cee33e 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs @@ -1141,7 +1141,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -1365,14 +1370,14 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: - return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( - dafnyVal._ComAmazonawsDynamodb - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyPrimitives ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: + return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( + dafnyVal._ComAmazonawsDynamodb + ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_DynamoDbEncryptionException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S27_DynamoDbEncryptionException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.Error_CollectionOfErrors dafnyVal: diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs index 396852a23..3840542c5 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs @@ -4053,7 +4053,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -6489,6 +6494,10 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor + ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption @@ -6501,10 +6510,6 @@ public static System.Exception FromDafny_CommonError(software.amazon.cryptograph return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( dafnyVal._ComAmazonawsDynamodb ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptor - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_DynamoDbEncryptionTransformsException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N10_transforms__S37_DynamoDbEncryptionTransformsException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.internaldafny.types.Error_CollectionOfErrors dafnyVal: diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs index 54124cea9..7c7395284 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs @@ -787,7 +787,12 @@ public static System.IO.MemoryStream FromDafny_N3_com__N9_amazonaws__N8_dynamodb } public static Dafny.ISequence ToDafny_N3_com__N9_amazonaws__N8_dynamodb__S20_BinaryAttributeValue(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Collections.Generic.List FromDafny_N3_com__N9_amazonaws__N8_dynamodb__S23_StringSetAttributeValue(Dafny.ISequence> value) { @@ -946,32 +951,37 @@ public static System.IO.MemoryStream FromDafny_N6_smithy__N3_api__S4_Blob(Dafny. } public static Dafny.ISequence ToDafny_N6_smithy__N3_api__S4_Blob(System.IO.MemoryStream value) { + if (value.ToArray().Length == 0 && value.Length > 0) + { + throw new System.ArgumentException("Fatal Error: MemoryStream instance not backed by an array!"); + } return Dafny.Sequence.FromArray(value.ToArray()); + } public static System.Exception FromDafny_CommonError(software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types._IError value) { switch (value) { - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: - return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyPrimitives + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDb dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb + ); + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: + return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyMaterialProviders dafnyVal: return AWS.Cryptography.MaterialProviders.TypeConversion.FromDafny_CommonError( dafnyVal._AwsCryptographyMaterialProviders ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkStructuredEncryption dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkStructuredEncryption + case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyPrimitives dafnyVal: + return AWS.Cryptography.Primitives.TypeConversion.FromDafny_CommonError( + dafnyVal._AwsCryptographyPrimitives ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_ComAmazonawsDynamodb dafnyVal: return Com.Amazonaws.Dynamodb.TypeConversion.FromDafny_CommonError( dafnyVal._ComAmazonawsDynamodb ); - case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_AwsCryptographyDbEncryptionSdkDynamoDb dafnyVal: - return AWS.Cryptography.DbEncryptionSDK.DynamoDb.TypeConversion.FromDafny_CommonError( - dafnyVal._AwsCryptographyDbEncryptionSdkDynamoDb - ); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_DynamoDbItemEncryptorException dafnyVal: return FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N13_itemEncryptor__S30_DynamoDbItemEncryptorException(dafnyVal); case software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.Error_CollectionOfErrors dafnyVal: From 6ed40230b85ea9e9f66b925e0fe6f345a0b35960 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 25 Mar 2024 17:30:33 -0700 Subject: [PATCH 34/40] Missed merge conflict --- .../DynamoDbEncryptionTransforms/test/TestFixtures.dfy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy index e298c607d..f8a13e598 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/test/TestFixtures.dfy @@ -128,15 +128,9 @@ module TestFixtures { legacyOverride := None(), plaintextOverride := None() ); -<<<<<<< HEAD - var iencryptor: IDynamoDbItemEncryptorClient :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); - expect iencryptor is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; - encryptor := iencryptor as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; -======= var encryptor2 : IDynamoDbItemEncryptorClient :- expect DynamoDbItemEncryptor.DynamoDbItemEncryptor(encryptorConfig); assert encryptor2 is DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; encryptor := encryptor2 as DynamoDbItemEncryptor.DynamoDbItemEncryptorClient; ->>>>>>> 56f1cd14d84dd660a62eff7b3e346a621b731de4 } method GetDynamoDbItemEncryptor() From 111854485b158d31add2d9273346bc827e1e9e28 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 25 Mar 2024 18:09:10 -0700 Subject: [PATCH 35/40] Only regenerate project properties files in nightly build --- .github/actions/polymorph_codegen/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 1051743e6..f5801d9df 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -76,6 +76,7 @@ runs: # Update the project.properties file so that we pick up the right runtimes etc., # in cases where inputs.dafny is different from the current value in that file. - name: Generate smithy-dafny-project.properties file + if: inputs.update-and-regenerate-mpl == 'true' env: DAFNY_VERSION: ${{ inputs.dafny }} shell: bash @@ -83,6 +84,7 @@ runs: make generate_properties_file - name: Update top-level project.properties file + if: inputs.update-and-regenerate-mpl == 'true' shell: bash run: | awk -F= '!a[$1]++' smithy-dafny-project.properties project.properties > merged.properties From 3eaa6a8ed2c683e298ad210968e735db1c43b9eb Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 25 Mar 2024 21:36:45 -0700 Subject: [PATCH 36/40] Select DafnyRuntime version dynamically --- .../runtimes/net/DynamoDbEncryption.csproj | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj index 255456b5b..cfc100fce 100644 --- a/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj +++ b/DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj @@ -31,10 +31,35 @@ CS0105,CS0618 + + + + $([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)/../../../project.properties')) + + + $([System.Text.RegularExpressions.Regex]::Split("$(projectProperties)", "dafnyRuntimeJavaVersion=")[1]) + + + $([System.Text.RegularExpressions.Regex]::Split("$(dropBeforeDafnyVersionProperty)", "\n")[1]) + + + - + - - $([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)/../../../project.properties')) - - - $([System.Text.RegularExpressions.Regex]::Split("$(projectProperties)", "dafnyRuntimeJavaVersion=")[1]) - - - $([System.Text.RegularExpressions.Regex]::Split("$(dropBeforeDafnyVersionProperty)", "\n")[1]) - - - +