diff --git a/.github/not-grep.toml b/.github/not-grep.toml index 713356b490..cd59507f15 100644 --- a/.github/not-grep.toml +++ b/.github/not-grep.toml @@ -1,13 +1,13 @@ [prefix] -"**/*.smithy" = """ +"**/[!smithy-dafny-codegen-modules]/**/*.smithy" = """ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 """ -"**/*.java" = """ +"**/[!smithy-dafny-codegen-modules]/**/*.java" = """ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 """ -"**/[!/obj/]*.cs" = """ +"**/[!smithy-dafny-codegen-modules]/**/[!/obj/]*.cs" = """ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 """ @@ -16,15 +16,15 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 """ -"**/*.kts" = """ +"**/[!smithy-dafny-codegen-modules]/**/*.kts" = """ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 """ -"**/*.mk" = """ +"**/[!smithy-dafny-codegen-modules]/**/*.mk" = """ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ -"**/Makefile" = """ +"**/[!smithy-dafny-codegen-modules]/**/Makefile" = """ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -""" +""" \ No newline at end of file diff --git a/.github/workflows/smithy-dafny-conversion.yml b/.github/workflows/smithy-dafny-conversion.yml index e835e5a7a5..3d89cc932b 100644 --- a/.github/workflows/smithy-dafny-conversion.yml +++ b/.github/workflows/smithy-dafny-conversion.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions/setup-java@v3 with: distribution: "corretto" diff --git a/.github/workflows/smithy-polymorph.yml b/.github/workflows/smithy-polymorph.yml index 654469c377..a84c74f01e 100644 --- a/.github/workflows/smithy-polymorph.yml +++ b/.github/workflows/smithy-polymorph.yml @@ -15,6 +15,8 @@ jobs: runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions/setup-java@v3 with: distribution: "corretto" @@ -29,6 +31,12 @@ jobs: # Matching the hard-coded version for the "2023" edition for now dafny-version: 4.1.0 + - name: Install smithy-dafny-codegen dependencies locally + uses: gradle/gradle-build-action@v2 + with: + arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML + build-root-directory: smithy-dafny-codegen-modules/smithy-rs + - name: Execute smithy-dafny-codegen-cli tests uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/test_models_dafny_verification.yml b/.github/workflows/test_models_dafny_verification.yml index 33d394f823..24bcd13ecd 100644 --- a/.github/workflows/test_models_dafny_verification.yml +++ b/.github/workflows/test_models_dafny_verification.yml @@ -44,6 +44,8 @@ jobs: git config --global core.longpaths true - uses: actions/checkout@v2 + with: + submodules: recursive - name: Setup Dafny uses: dafny-lang/setup-dafny-action@v1.7.0 @@ -56,6 +58,12 @@ jobs: distribution: "corretto" java-version: "17" + - name: Install smithy-dafny-codegen dependencies locally + uses: gradle/gradle-build-action@v2 + with: + arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML + build-root-directory: smithy-dafny-codegen-modules/smithy-rs + - name: Install smithy-dafny-codegen locally uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/test_models_java_tests.yml b/.github/workflows/test_models_java_tests.yml index d1bf62d9a1..701240e5c3 100644 --- a/.github/workflows/test_models_java_tests.yml +++ b/.github/workflows/test_models_java_tests.yml @@ -48,6 +48,8 @@ jobs: role-session-name: JavaTests - uses: actions/checkout@v3 + with: + submodules: recursive - name: Setup Dafny uses: dafny-lang/setup-dafny-action@v1.7.0 @@ -66,6 +68,12 @@ jobs: arguments: publishToMavenLocal build-root-directory: smithy-dafny-conversion + - name: Install smithy-dafny-codegen dependencies locally + uses: gradle/gradle-build-action@v2 + with: + arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML + build-root-directory: smithy-dafny-codegen-modules/smithy-rs + - name: Install smithy-dafny-codegen locally uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/test_models_net_tests.yml b/.github/workflows/test_models_net_tests.yml index 7e6e8abf85..c62ab35da5 100644 --- a/.github/workflows/test_models_net_tests.yml +++ b/.github/workflows/test_models_net_tests.yml @@ -52,6 +52,8 @@ jobs: role-session-name: NetTests - uses: actions/checkout@v3 + with: + submodules: recursive - name: Setup Dafny uses: dafny-lang/setup-dafny-action@v1.7.0 @@ -76,6 +78,12 @@ jobs: distribution: "corretto" java-version: "17" + - name: Install smithy-dafny-codegen dependencies locally + uses: gradle/gradle-build-action@v2 + with: + arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML + build-root-directory: smithy-dafny-codegen-modules/smithy-rs + - name: Install smithy-dafny-codegen locally uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/test_models_rust_tests.yml b/.github/workflows/test_models_rust_tests.yml index 74ce985eed..e14f5d8ad3 100644 --- a/.github/workflows/test_models_rust_tests.yml +++ b/.github/workflows/test_models_rust_tests.yml @@ -48,6 +48,8 @@ jobs: role-session-name: JavaTests - uses: actions/checkout@v3 + with: + submodules: recursive - name: Setup Dafny (build from source) uses: ./.github/actions/build_dafny_from_source @@ -67,6 +69,12 @@ jobs: distribution: "corretto" java-version: "17" + - name: Install smithy-dafny-codegen dependencies locally + uses: gradle/gradle-build-action@v2 + with: + arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML + build-root-directory: smithy-dafny-codegen-modules/smithy-rs + - name: Install smithy-dafny-codegen locally uses: gradle/gradle-build-action@v2 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..799149742e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "smithy-dafny-codegen-modules/smithy-rs"] + path = smithy-dafny-codegen-modules/smithy-rs + url = git@github.com:smithy-lang/smithy-rs.git diff --git a/SmithyDafnyMakefile.mk b/SmithyDafnyMakefile.mk index 03176408ca..4ed381c43a 100644 --- a/SmithyDafnyMakefile.mk +++ b/SmithyDafnyMakefile.mk @@ -516,7 +516,8 @@ test_java: ########################## Rust targets -# TODO: blah blah Rust only supports a single crate for everything +# The Dafny Rust code generator only supports a single crate for everything, +# so (among other consequences) we compile src and test code together. transpile_rust: | transpile_implementation_rust transpile_dependencies_rust transpile_implementation_rust: TARGET=rs @@ -526,7 +527,8 @@ transpile_implementation_rust: TEST_INDEX=$(RUST_TEST_INDEX) # The Dafny Rust code generator is not complete yet, # so we want to emit code even if there are unsupported features in the input. transpile_implementation_rust: DAFNY_OPTIONS=-emitUncompilableCode -# TODO: +# The Dafny Rust code generator only supports a single crate for everything, +# so we inline all dependencies by not passing `-library` to Dafny. transpile_implementation_rust: TRANSPILE_DEPENDENCIES= transpile_implementation_rust: STD_LIBRARY= transpile_implementation_rust: SRC_INDEX_TRANSPILE=$(if $(SRC_INDEX),$(SRC_INDEX),src) @@ -536,9 +538,18 @@ transpile_implementation_rust: $(if $(TRANSPILE_TESTS_IN_RUST), transpile_test, transpile_dependencies_rust: LANG=rust transpile_dependencies_rust: transpile_dependencies +_mv_implementation_rust: RUST_EXTERN_MODULE_DECLARATIONS=$(if $(AWS_SDK_CMD), \ +mod client; \ +mod conversions; \ +mod standard_library_conversions;, ) _mv_implementation_rust: mkdir -p runtimes/rust/src - mv implementation_from_dafny-rust/src/implementation_from_dafny.rs runtimes/rust/src/implementation_from_dafny.rs +# Dafny-generated code assumes its output will be the main library file, +# so we need to splice in module declarations for any extern code. + $(if $(AWS_SDK_CMD), \ + python3 -c "import sys; data = sys.stdin.buffer.read(); sys.stdout.buffer.write(data.replace(b'\npub mod', b'\n$(RUST_EXTERN_MODULE_DECLARATIONS)\n\npub mod', 1) if b'\npub mod' in data else data)" \ + < implementation_from_dafny-rust/src/implementation_from_dafny.rs > runtimes/rust/src/implementation_from_dafny.rs, \ + mv implementation_from_dafny-rust/src/implementation_from_dafny.rs runtimes/rust/src/implementation_from_dafny.rs) rustfmt runtimes/rust/src/implementation_from_dafny.rs rm -rf implementation_from_dafny-rust diff --git a/TestModels/aws-sdks/ddb-lite/Makefile b/TestModels/aws-sdks/ddb-lite/Makefile index 76a742306c..4f86ac17f9 100644 --- a/TestModels/aws-sdks/ddb-lite/Makefile +++ b/TestModels/aws-sdks/ddb-lite/Makefile @@ -8,11 +8,13 @@ CORES=2 +TRANSPILE_TESTS_IN_RUST=1 + include ../../SharedMakefile.mk PROJECT_SERVICES := \ - ComAmazonawsDynamodb \ + ComAmazonawsDynamodb SERVICE_NAMESPACE_ComAmazonawsDynamodb=com.amazonaws.dynamodb @@ -38,6 +40,9 @@ _polymorph_dotnet: _polymorph_java: $(GRADLEW) polymorphJava +_polymorph_rust: + $(GRADLEW) polymorphRust + # There is no wrapped target for aws-sdk types _polymorph: ; _polymorph_wrapped: ; diff --git a/TestModels/aws-sdks/ddb-lite/build.gradle.kts b/TestModels/aws-sdks/ddb-lite/build.gradle.kts index 2214d0b620..0fcdd54507 100644 --- a/TestModels/aws-sdks/ddb-lite/build.gradle.kts +++ b/TestModels/aws-sdks/ddb-lite/build.gradle.kts @@ -74,6 +74,19 @@ tasks.register("polymorphJava") { } } +tasks.register("polymorphRust") { + dependsOn("build") + doLast { + // if needed, specify a projection to use instead + // default (no projection) is "source" + val projectionName = "operation-subset" + copy { + from(layout.buildDirectory.dir("smithyprojections/" + project.name + "/" + projectionName + "/dafny-client-codegen/runtimes/rust/src")) + into("runtimes/rust/src") + } + } +} + buildscript { val smithyVersion: String by project diff --git a/TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy b/TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy new file mode 100644 index 0000000000..0cb9c804f2 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy @@ -0,0 +1,1090 @@ +// 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. +include "../../../dafny-dependencies/StandardLibrary/src/Index.dfy" +module {:extern "software.amazon.cryptography.services.dynamodb.internaldafny.types" } ComAmazonawsDynamodbTypes +{ + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + // Generic helpers for verification of mock/unit tests. + datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) + + // Begin Generated Types + + type ArchivalReason = string + datatype ArchivalSummary = | ArchivalSummary ( + nameonly ArchivalDateTime: Option := Option.None , + nameonly ArchivalReason: Option := Option.None , + nameonly ArchivalBackupArn: Option := Option.None + ) + datatype AttributeAction = + | ADD + | PUT + | DELETE + datatype AttributeDefinition = | AttributeDefinition ( + nameonly AttributeName: KeySchemaAttributeName , + nameonly AttributeType: ScalarAttributeType + ) + type AttributeDefinitions = seq + type AttributeMap = map + type AttributeName = x: string | IsValid_AttributeName(x) witness * + predicate method IsValid_AttributeName(x: string) { + ( 0 <= |x| <= 65535 ) + } + type AttributeNameList = x: seq | IsValid_AttributeNameList(x) witness * + predicate method IsValid_AttributeNameList(x: seq) { + ( 1 <= |x| ) + } + type AttributeUpdates = map + datatype AttributeValue = + | S(S: StringAttributeValue) + | N(N: NumberAttributeValue) + | B(B: BinaryAttributeValue) + | SS(SS: StringSetAttributeValue) + | NS(NS: NumberSetAttributeValue) + | BS(BS: BinarySetAttributeValue) + | M(M: MapAttributeValue) + | L(L: ListAttributeValue) + | NULL(NULL: NullAttributeValue) + | BOOL(BOOL: BooleanAttributeValue) + type AttributeValueList = seq + datatype AttributeValueUpdate = | AttributeValueUpdate ( + nameonly Value: Option := Option.None , + nameonly Action: Option := Option.None + ) + type Backfilling = bool + type BackupArn = x: string | IsValid_BackupArn(x) witness * + predicate method IsValid_BackupArn(x: string) { + ( 37 <= |x| <= 1024 ) + } + datatype BatchGetItemInput = | BatchGetItemInput ( + nameonly RequestItems: BatchGetRequestMap , + nameonly ReturnConsumedCapacity: Option := Option.None + ) + datatype BatchGetItemOutput = | BatchGetItemOutput ( + nameonly Responses: Option := Option.None , + nameonly UnprocessedKeys: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None + ) + type BatchGetRequestMap = x: map | IsValid_BatchGetRequestMap(x) witness * + predicate method IsValid_BatchGetRequestMap(x: map) { + ( 1 <= |x| <= 100 ) + } + type BatchGetResponseMap = map + datatype BillingMode = + | PROVISIONED + | PAY_PER_REQUEST + datatype BillingModeSummary = | BillingModeSummary ( + nameonly BillingMode: Option := Option.None , + nameonly LastUpdateToPayPerRequestDateTime: Option := Option.None + ) + type BinaryAttributeValue = seq + type BinarySetAttributeValue = seq + type BooleanAttributeValue = bool + type BooleanObject = bool + datatype CancellationReason = | CancellationReason ( + nameonly Item: Option := Option.None , + nameonly Code: Option := Option.None , + nameonly Message: Option := Option.None + ) + type CancellationReasonList = x: seq | IsValid_CancellationReasonList(x) witness * + predicate method IsValid_CancellationReasonList(x: seq) { + ( 1 <= |x| <= 25 ) + } + datatype Capacity = | Capacity ( + nameonly ReadCapacityUnits: Option := Option.None , + nameonly WriteCapacityUnits: Option := Option.None , + nameonly CapacityUnits: Option := Option.None + ) + type ClientRequestToken = x: string | IsValid_ClientRequestToken(x) witness * + predicate method IsValid_ClientRequestToken(x: string) { + ( 1 <= |x| <= 36 ) + } + type Code = string + datatype ComparisonOperator = + | EQ + | NE + | IN + | LE + | LT + | GE + | GT + | BETWEEN + | NOT_NULL + | NULL + | CONTAINS + | NOT_CONTAINS + | BEGINS_WITH + datatype Condition = | Condition ( + nameonly AttributeValueList: Option := Option.None , + nameonly ComparisonOperator: ComparisonOperator + ) + datatype ConditionalOperator = + | AND + | OR + datatype ConditionCheck = | ConditionCheck ( + nameonly Key: Key , + nameonly TableName: TableName , + nameonly ConditionExpression: ConditionExpression , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None , + nameonly ReturnValuesOnConditionCheckFailure: Option := Option.None + ) + type ConditionExpression = string + type ConsistentRead = bool + datatype ConsumedCapacity = | ConsumedCapacity ( + nameonly TableName: Option := Option.None , + nameonly CapacityUnits: Option := Option.None , + nameonly ReadCapacityUnits: Option := Option.None , + nameonly WriteCapacityUnits: Option := Option.None , + nameonly Table: Option := Option.None , + nameonly LocalSecondaryIndexes: Option := Option.None , + nameonly GlobalSecondaryIndexes: Option := Option.None + ) + type ConsumedCapacityMultiple = seq + type ConsumedCapacityUnits = x: seq | IsValid_ConsumedCapacityUnits(x) witness * + predicate method IsValid_ConsumedCapacityUnits(x: seq) { + ( 8 <= |x| <= 8 ) + } + datatype CreateTableInput = | CreateTableInput ( + nameonly AttributeDefinitions: AttributeDefinitions , + nameonly TableName: TableName , + nameonly KeySchema: KeySchema , + nameonly LocalSecondaryIndexes: Option := Option.None , + nameonly GlobalSecondaryIndexes: Option := Option.None , + nameonly BillingMode: Option := Option.None , + nameonly ProvisionedThroughput: Option := Option.None , + nameonly StreamSpecification: Option := Option.None , + nameonly SSESpecification: Option := Option.None , + nameonly Tags: Option := Option.None , + nameonly TableClass: Option := Option.None + ) + datatype CreateTableOutput = | CreateTableOutput ( + nameonly TableDescription: Option := Option.None + ) + datatype Delete = | Delete ( + nameonly Key: Key , + nameonly TableName: TableName , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None , + nameonly ReturnValuesOnConditionCheckFailure: Option := Option.None + ) + datatype DeleteItemInput = | DeleteItemInput ( + nameonly TableName: TableName , + nameonly Key: Key , + nameonly Expected: Option := Option.None , + nameonly ConditionalOperator: Option := Option.None , + nameonly ReturnValues: Option := Option.None , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly ReturnItemCollectionMetrics: Option := Option.None , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None + ) + datatype DeleteItemOutput = | DeleteItemOutput ( + nameonly Attributes: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None , + nameonly ItemCollectionMetrics: Option := Option.None + ) + datatype DescribeTableInput = | DescribeTableInput ( + nameonly TableName: TableName + ) + datatype DescribeTableOutput = | DescribeTableOutput ( + nameonly Table: Option := Option.None + ) + class IDynamoDBClientCallHistory { + ghost constructor() { + BatchGetItem := []; + CreateTable := []; + DeleteItem := []; + DescribeTable := []; + GetItem := []; + PutItem := []; + Query := []; + Scan := []; + TransactWriteItems := []; + UpdateItem := []; + } + ghost var BatchGetItem: seq>> + ghost var CreateTable: seq>> + ghost var DeleteItem: seq>> + ghost var DescribeTable: seq>> + ghost var GetItem: seq>> + ghost var PutItem: seq>> + ghost var Query: seq>> + ghost var Scan: seq>> + ghost var TransactWriteItems: seq>> + ghost var UpdateItem: seq>> + } + trait {:termination false} IDynamoDBClient + { + // 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: IDynamoDBClientCallHistory + predicate BatchGetItemEnsuresPublicly(input: BatchGetItemInput , output: Result) + // The public method to be called by library consumers + method BatchGetItem ( input: BatchGetItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`BatchGetItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures BatchGetItemEnsuresPublicly(input, output) + ensures History.BatchGetItem == old(History.BatchGetItem) + [DafnyCallEvent(input, output)] + + predicate CreateTableEnsuresPublicly(input: CreateTableInput , output: Result) + // The public method to be called by library consumers + method CreateTable ( input: CreateTableInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`CreateTable + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures CreateTableEnsuresPublicly(input, output) + ensures History.CreateTable == old(History.CreateTable) + [DafnyCallEvent(input, output)] + + predicate DeleteItemEnsuresPublicly(input: DeleteItemInput , output: Result) + // The public method to be called by library consumers + method DeleteItem ( input: DeleteItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DeleteItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DeleteItemEnsuresPublicly(input, output) + ensures History.DeleteItem == old(History.DeleteItem) + [DafnyCallEvent(input, output)] + + predicate DescribeTableEnsuresPublicly(input: DescribeTableInput , output: Result) + // The public method to be called by library consumers + method DescribeTable ( input: DescribeTableInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`DescribeTable + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures DescribeTableEnsuresPublicly(input, output) + ensures History.DescribeTable == old(History.DescribeTable) + [DafnyCallEvent(input, output)] + + predicate GetItemEnsuresPublicly(input: GetItemInput , output: Result) + // The public method to be called by library consumers + method GetItem ( input: GetItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`GetItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures GetItemEnsuresPublicly(input, output) + ensures History.GetItem == old(History.GetItem) + [DafnyCallEvent(input, output)] + + predicate PutItemEnsuresPublicly(input: PutItemInput , output: Result) + // The public method to be called by library consumers + method PutItem ( input: PutItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`PutItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures PutItemEnsuresPublicly(input, output) + ensures History.PutItem == old(History.PutItem) + [DafnyCallEvent(input, output)] + + predicate QueryEnsuresPublicly(input: QueryInput , output: Result) + // The public method to be called by library consumers + method Query ( input: QueryInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`Query + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures QueryEnsuresPublicly(input, output) + ensures History.Query == old(History.Query) + [DafnyCallEvent(input, output)] + + predicate ScanEnsuresPublicly(input: ScanInput , output: Result) + // The public method to be called by library consumers + method Scan ( input: ScanInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`Scan + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures ScanEnsuresPublicly(input, output) + ensures History.Scan == old(History.Scan) + [DafnyCallEvent(input, output)] + + predicate TransactWriteItemsEnsuresPublicly(input: TransactWriteItemsInput , output: Result) + // The public method to be called by library consumers + method TransactWriteItems ( input: TransactWriteItemsInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`TransactWriteItems + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures TransactWriteItemsEnsuresPublicly(input, output) + ensures History.TransactWriteItems == old(History.TransactWriteItems) + [DafnyCallEvent(input, output)] + + predicate UpdateItemEnsuresPublicly(input: UpdateItemInput , output: Result) + // The public method to be called by library consumers + method UpdateItem ( input: UpdateItemInput ) + returns (output: Result) + requires + && ValidState() + modifies Modifies - {History} , + History`UpdateItem + // Dafny will skip type parameters when generating a default decreases clause. + decreases Modifies - {History} + ensures + && ValidState() + ensures UpdateItemEnsuresPublicly(input, output) + ensures History.UpdateItem == old(History.UpdateItem) + [DafnyCallEvent(input, output)] + + } + type ErrorMessage = string + type ExpectedAttributeMap = map + datatype ExpectedAttributeValue = | ExpectedAttributeValue ( + nameonly Value: Option := Option.None , + nameonly Exists: Option := Option.None , + nameonly ComparisonOperator: Option := Option.None , + nameonly AttributeValueList: Option := Option.None + ) + type ExpressionAttributeNameMap = map + type ExpressionAttributeNameVariable = string + type ExpressionAttributeValueMap = map + type ExpressionAttributeValueVariable = string + type FilterConditionMap = map + datatype GetItemInput = | GetItemInput ( + nameonly TableName: TableName , + nameonly Key: Key , + nameonly AttributesToGet: Option := Option.None , + nameonly ConsistentRead: Option := Option.None , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly ProjectionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None + ) + datatype GetItemOutput = | GetItemOutput ( + nameonly Item: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None + ) + datatype GlobalSecondaryIndex = | GlobalSecondaryIndex ( + nameonly IndexName: IndexName , + nameonly KeySchema: KeySchema , + nameonly Projection: Projection , + nameonly ProvisionedThroughput: Option := Option.None + ) + datatype GlobalSecondaryIndexDescription = | GlobalSecondaryIndexDescription ( + nameonly IndexName: Option := Option.None , + nameonly KeySchema: Option := Option.None , + nameonly Projection: Option := Option.None , + nameonly IndexStatus: Option := Option.None , + nameonly Backfilling: Option := Option.None , + nameonly ProvisionedThroughput: Option := Option.None , + nameonly IndexSizeBytes: Option := Option.None , + nameonly ItemCount: Option := Option.None , + nameonly IndexArn: Option := Option.None + ) + type GlobalSecondaryIndexDescriptionList = seq + type GlobalSecondaryIndexList = seq + type IndexName = x: string | IsValid_IndexName(x) witness * + predicate method IsValid_IndexName(x: string) { + ( 3 <= |x| <= 255 ) + } + datatype IndexStatus = + | CREATING + | UPDATING + | DELETING + | ACTIVE + type Integer = int32 + type ItemCollectionKeyAttributeMap = map + datatype ItemCollectionMetrics = | ItemCollectionMetrics ( + nameonly ItemCollectionKey: Option := Option.None , + nameonly SizeEstimateRangeGB: Option := Option.None + ) + type ItemCollectionMetricsMultiple = seq + type ItemCollectionMetricsPerTable = map + type ItemCollectionSizeEstimateBound = x: seq | IsValid_ItemCollectionSizeEstimateBound(x) witness * + predicate method IsValid_ItemCollectionSizeEstimateBound(x: seq) { + ( 8 <= |x| <= 8 ) + } + type ItemCollectionSizeEstimateRange = seq + type ItemList = seq + type Key = map + type KeyConditions = map + type KeyExpression = string + type KeyList = x: seq | IsValid_KeyList(x) witness * + predicate method IsValid_KeyList(x: seq) { + ( 1 <= |x| <= 100 ) + } + datatype KeysAndAttributes = | KeysAndAttributes ( + nameonly Keys: KeyList , + nameonly AttributesToGet: Option := Option.None , + nameonly ConsistentRead: Option := Option.None , + nameonly ProjectionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None + ) + type KeySchema = x: seq | IsValid_KeySchema(x) witness * + predicate method IsValid_KeySchema(x: seq) { + ( 1 <= |x| <= 2 ) + } + type KeySchemaAttributeName = x: string | IsValid_KeySchemaAttributeName(x) witness * + predicate method IsValid_KeySchemaAttributeName(x: string) { + ( 1 <= |x| <= 255 ) + } + datatype KeySchemaElement = | KeySchemaElement ( + nameonly AttributeName: KeySchemaAttributeName , + nameonly KeyType: KeyType + ) + datatype KeyType = + | HASH + | RANGE + type KMSMasterKeyArn = string + type KMSMasterKeyId = string + type ListAttributeValue = seq + datatype LocalSecondaryIndex = | LocalSecondaryIndex ( + nameonly IndexName: IndexName , + nameonly KeySchema: KeySchema , + nameonly Projection: Projection + ) + datatype LocalSecondaryIndexDescription = | LocalSecondaryIndexDescription ( + nameonly IndexName: Option := Option.None , + nameonly KeySchema: Option := Option.None , + nameonly Projection: Option := Option.None , + nameonly IndexSizeBytes: Option := Option.None , + nameonly ItemCount: Option := Option.None , + nameonly IndexArn: Option := Option.None + ) + type LocalSecondaryIndexDescriptionList = seq + type LocalSecondaryIndexList = seq + type Long = int64 + type MapAttributeValue = map + type NonKeyAttributeName = x: string | IsValid_NonKeyAttributeName(x) witness * + predicate method IsValid_NonKeyAttributeName(x: string) { + ( 1 <= |x| <= 255 ) + } + type NonKeyAttributeNameList = x: seq | IsValid_NonKeyAttributeNameList(x) witness * + predicate method IsValid_NonKeyAttributeNameList(x: seq) { + ( 1 <= |x| <= 20 ) + } + type NonNegativeLongObject = x: int64 | IsValid_NonNegativeLongObject(x) witness * + predicate method IsValid_NonNegativeLongObject(x: int64) { + ( 0 <= x ) + } + type NullAttributeValue = bool + type NumberAttributeValue = string + type NumberSetAttributeValue = seq + type PositiveIntegerObject = x: int32 | IsValid_PositiveIntegerObject(x) witness * + predicate method IsValid_PositiveIntegerObject(x: int32) { + ( 1 <= x ) + } + type PositiveLongObject = x: int64 | IsValid_PositiveLongObject(x) witness * + predicate method IsValid_PositiveLongObject(x: int64) { + ( 1 <= x ) + } + datatype Projection = | Projection ( + nameonly ProjectionType: Option := Option.None , + nameonly NonKeyAttributes: Option := Option.None + ) + type ProjectionExpression = string + datatype ProjectionType = + | ALL + | KEYS_ONLY + | INCLUDE + datatype ProvisionedThroughput = | ProvisionedThroughput ( + nameonly ReadCapacityUnits: PositiveLongObject , + nameonly WriteCapacityUnits: PositiveLongObject + ) + datatype ProvisionedThroughputDescription = | ProvisionedThroughputDescription ( + nameonly LastIncreaseDateTime: Option := Option.None , + nameonly LastDecreaseDateTime: Option := Option.None , + nameonly NumberOfDecreasesToday: Option := Option.None , + nameonly ReadCapacityUnits: Option := Option.None , + nameonly WriteCapacityUnits: Option := Option.None + ) + datatype ProvisionedThroughputOverride = | ProvisionedThroughputOverride ( + nameonly ReadCapacityUnits: Option := Option.None + ) + datatype Put = | Put ( + nameonly Item: PutItemInputAttributeMap , + nameonly TableName: TableName , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None , + nameonly ReturnValuesOnConditionCheckFailure: Option := Option.None + ) + datatype PutItemInput = | PutItemInput ( + nameonly TableName: TableName , + nameonly Item: PutItemInputAttributeMap , + nameonly Expected: Option := Option.None , + nameonly ReturnValues: Option := Option.None , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly ReturnItemCollectionMetrics: Option := Option.None , + nameonly ConditionalOperator: Option := Option.None , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None + ) + type PutItemInputAttributeMap = map + datatype PutItemOutput = | PutItemOutput ( + nameonly Attributes: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None , + nameonly ItemCollectionMetrics: Option := Option.None + ) + datatype QueryInput = | QueryInput ( + nameonly TableName: TableName , + nameonly IndexName: Option := Option.None , + nameonly Select: Option := Option.None , + nameonly ScanFilter: Option := Option.None , + nameonly ConditionalOperator: Option := Option.None , + nameonly ExclusiveStartKey: Option := Option.None , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly TotalSegments: Option := Option.None , + nameonly Segment: Option := Option.None , + nameonly ProjectionExpression: Option := Option.None , + nameonly FilterExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None , + nameonly ConsistentRead: Option := Option.None + ) + datatype ScanOutput = | ScanOutput ( + nameonly Items: Option := Option.None , + nameonly Count: Option := Option.None , + nameonly ScannedCount: Option := Option.None , + nameonly LastEvaluatedKey: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None + ) + type ScanSegment = x: int32 | IsValid_ScanSegment(x) witness * + predicate method IsValid_ScanSegment(x: int32) { + ( 0 <= x <= 999999 ) + } + type ScanTotalSegments = x: int32 | IsValid_ScanTotalSegments(x) witness * + predicate method IsValid_ScanTotalSegments(x: int32) { + ( 1 <= x <= 1000000 ) + } + type SecondaryIndexesCapacityMap = map + datatype Select = + | ALL_ATTRIBUTES + | ALL_PROJECTED_ATTRIBUTES + | SPECIFIC_ATTRIBUTES + | COUNT + datatype SSEDescription = | SSEDescription ( + nameonly Status: Option := Option.None , + nameonly SSEType: Option := Option.None , + nameonly KMSMasterKeyArn: Option := Option.None , + nameonly InaccessibleEncryptionDateTime: Option := Option.None + ) + type SSEEnabled = bool + datatype SSESpecification = | SSESpecification ( + nameonly Enabled: Option := Option.None , + nameonly SSEType: Option := Option.None , + nameonly KMSMasterKeyId: Option := Option.None + ) + datatype SSEStatus = + | ENABLING + | ENABLED + | DISABLING + | DISABLED + | UPDATING + datatype SSEType = + | AES256 + | KMS + type StreamArn = x: string | IsValid_StreamArn(x) witness * + predicate method IsValid_StreamArn(x: string) { + ( 37 <= |x| <= 1024 ) + } + type StreamEnabled = bool + datatype StreamSpecification = | StreamSpecification ( + nameonly StreamEnabled: StreamEnabled , + nameonly StreamViewType: Option := Option.None + ) + datatype StreamViewType = + | NEW_IMAGE + | OLD_IMAGE + | NEW_AND_OLD_IMAGES + | KEYS_ONLY + type String = string + type StringAttributeValue = string + type StringSetAttributeValue = seq + type TableArn = string + datatype TableClass = + | STANDARD + | STANDARD_INFREQUENT_ACCESS + datatype TableClassSummary = | TableClassSummary ( + nameonly TableClass: Option := Option.None , + nameonly LastUpdateDateTime: Option := Option.None + ) + datatype TableDescription = | TableDescription ( + nameonly AttributeDefinitions: Option := Option.None , + nameonly TableName: Option := Option.None , + nameonly KeySchema: Option := Option.None , + nameonly TableStatus: Option := Option.None , + nameonly CreationDateTime: Option := Option.None , + nameonly ProvisionedThroughput: Option := Option.None , + nameonly TableSizeBytes: Option := Option.None , + nameonly ItemCount: Option := Option.None , + nameonly TableArn: Option := Option.None , + nameonly TableId: Option := Option.None , + nameonly BillingModeSummary: Option := Option.None , + nameonly LocalSecondaryIndexes: Option := Option.None , + nameonly GlobalSecondaryIndexes: Option := Option.None , + nameonly StreamSpecification: Option := Option.None , + nameonly LatestStreamLabel: Option := Option.None , + nameonly LatestStreamArn: Option := Option.None , + nameonly GlobalTableVersion: Option := Option.None , + nameonly Replicas: Option := Option.None , + nameonly RestoreSummary: Option := Option.None , + nameonly SSEDescription: Option := Option.None , + nameonly ArchivalSummary: Option := Option.None , + nameonly TableClassSummary: Option := Option.None + ) + type TableId = string + type TableName = x: string | IsValid_TableName(x) witness * + predicate method IsValid_TableName(x: string) { + ( 3 <= |x| <= 255 ) + } + datatype TableStatus = + | CREATING + | UPDATING + | DELETING + | ACTIVE + | INACCESSIBLE_ENCRYPTION_CREDENTIALS + | ARCHIVING + | ARCHIVED + datatype Tag = | Tag ( + nameonly Key: TagKeyString , + nameonly Value: TagValueString + ) + type TagKeyString = x: string | IsValid_TagKeyString(x) witness * + predicate method IsValid_TagKeyString(x: string) { + ( 1 <= |x| <= 128 ) + } + type TagList = seq + type TagValueString = x: string | IsValid_TagValueString(x) witness * + predicate method IsValid_TagValueString(x: string) { + ( 0 <= |x| <= 256 ) + } + datatype TransactWriteItem = | TransactWriteItem ( + nameonly ConditionCheck: Option := Option.None , + nameonly Put: Option := Option.None , + nameonly Delete: Option := Option.None , + nameonly Update: Option := Option.None + ) + type TransactWriteItemList = x: seq | IsValid_TransactWriteItemList(x) witness * + predicate method IsValid_TransactWriteItemList(x: seq) { + ( 1 <= |x| <= 25 ) + } + datatype TransactWriteItemsInput = | TransactWriteItemsInput ( + nameonly TransactItems: TransactWriteItemList , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly ReturnItemCollectionMetrics: Option := Option.None , + nameonly ClientRequestToken: Option := Option.None + ) + datatype TransactWriteItemsOutput = | TransactWriteItemsOutput ( + nameonly ConsumedCapacity: Option := Option.None , + nameonly ItemCollectionMetrics: Option := Option.None + ) + datatype Update = | Update ( + nameonly Key: Key , + nameonly UpdateExpression: UpdateExpression , + nameonly TableName: TableName , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None , + nameonly ReturnValuesOnConditionCheckFailure: Option := Option.None + ) + type UpdateExpression = string + datatype UpdateItemInput = | UpdateItemInput ( + nameonly TableName: TableName , + nameonly Key: Key , + nameonly AttributeUpdates: Option := Option.None , + nameonly Expected: Option := Option.None , + nameonly ConditionalOperator: Option := Option.None , + nameonly ReturnValues: Option := Option.None , + nameonly ReturnConsumedCapacity: Option := Option.None , + nameonly ReturnItemCollectionMetrics: Option := Option.None , + nameonly UpdateExpression: Option := Option.None , + nameonly ConditionExpression: Option := Option.None , + nameonly ExpressionAttributeNames: Option := Option.None , + nameonly ExpressionAttributeValues: Option := Option.None + ) + datatype UpdateItemOutput = | UpdateItemOutput ( + nameonly Attributes: Option := Option.None , + nameonly ConsumedCapacity: Option := Option.None , + nameonly ItemCollectionMetrics: Option := Option.None + ) + datatype Error = + // Local Error structures are listed here + | ConditionalCheckFailedException ( + nameonly message: Option := Option.None + ) + | IdempotentParameterMismatchException ( + nameonly Message: Option := Option.None + ) + | InternalServerError ( + nameonly message: Option := Option.None + ) + | InvalidEndpointException ( + nameonly Message: Option := Option.None + ) + | ItemCollectionSizeLimitExceededException ( + nameonly message: Option := Option.None + ) + | LimitExceededException ( + nameonly message: Option := Option.None + ) + | ProvisionedThroughputExceededException ( + nameonly message: Option := Option.None + ) + | RequestLimitExceeded ( + nameonly message: Option := Option.None + ) + | ResourceInUseException ( + nameonly message: Option := Option.None + ) + | ResourceNotFoundException ( + nameonly message: Option := Option.None + ) + | TransactionCanceledException ( + nameonly Message: Option := Option.None , + nameonly CancellationReasons: Option := Option.None + ) + | TransactionConflictException ( + nameonly message: Option := Option.None + ) + | TransactionInProgressException ( + nameonly Message: Option := Option.None + ) + // Any dependent models are listed here + + + // The Opaque error, used for native, extern, wrapped or unknown errors + | Opaque(obj: object) + type OpaqueError = e: Error | e.Opaque? witness * +} +abstract module AbstractComAmazonawsDynamodbService { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = ComAmazonawsDynamodbTypes + datatype DynamoDBClientConfigType = DynamoDBClientConfigType + function method DefaultDynamoDBClientConfigType(): DynamoDBClientConfigType + method {:extern} DynamoDBClient() + returns (res: Result) + ensures res.Success? ==> + && fresh(res.value) + && fresh(res.value.Modifies) + && fresh(res.value.History) + && res.value.ValidState() + // Helper functions for the benefit of native code to create a Success(client) without referring to Dafny internals + function method CreateSuccessOfClient(client: IDynamoDBClient): Result { + Success(client) + } + function method CreateFailureOfError(error: Error): Result { + Failure(error) + } +} +abstract module AbstractComAmazonawsDynamodbOperations { + import opened Wrappers + import opened StandardLibrary.UInt + import opened UTF8 + import opened Types = ComAmazonawsDynamodbTypes + type InternalConfig + predicate ValidInternalConfig?(config: InternalConfig) + function ModifiesInternalConfig(config: InternalConfig): set + predicate BatchGetItemEnsuresPublicly(input: BatchGetItemInput , output: Result) + // The private method to be refined by the library developer + + + method BatchGetItem ( config: InternalConfig , input: BatchGetItemInput ) + 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 BatchGetItemEnsuresPublicly(input, output) + + + predicate CreateTableEnsuresPublicly(input: CreateTableInput , output: Result) + // The private method to be refined by the library developer + + + method CreateTable ( config: InternalConfig , input: CreateTableInput ) + 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 CreateTableEnsuresPublicly(input, output) + + + predicate DeleteItemEnsuresPublicly(input: DeleteItemInput , output: Result) + // The private method to be refined by the library developer + + + method DeleteItem ( config: InternalConfig , input: DeleteItemInput ) + 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 DeleteItemEnsuresPublicly(input, output) + + + predicate DescribeTableEnsuresPublicly(input: DescribeTableInput , output: Result) + // The private method to be refined by the library developer + + + method DescribeTable ( config: InternalConfig , input: DescribeTableInput ) + 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 DescribeTableEnsuresPublicly(input, output) + + + predicate GetItemEnsuresPublicly(input: GetItemInput , output: Result) + // The private method to be refined by the library developer + + + method GetItem ( config: InternalConfig , input: GetItemInput ) + 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 GetItemEnsuresPublicly(input, output) + + + predicate PutItemEnsuresPublicly(input: PutItemInput , output: Result) + // The private method to be refined by the library developer + + + method PutItem ( config: InternalConfig , input: PutItemInput ) + 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 PutItemEnsuresPublicly(input, output) + + + predicate QueryEnsuresPublicly(input: QueryInput , output: Result) + // The private method to be refined by the library developer + + + method Query ( config: InternalConfig , input: QueryInput ) + 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 QueryEnsuresPublicly(input, output) + + + predicate ScanEnsuresPublicly(input: ScanInput , output: Result) + // The private method to be refined by the library developer + + + method Scan ( config: InternalConfig , input: ScanInput ) + 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 ScanEnsuresPublicly(input, output) + + + predicate TransactWriteItemsEnsuresPublicly(input: TransactWriteItemsInput , output: Result) + // The private method to be refined by the library developer + + + method TransactWriteItems ( config: InternalConfig , input: TransactWriteItemsInput ) + 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 TransactWriteItemsEnsuresPublicly(input, output) + + + predicate UpdateItemEnsuresPublicly(input: UpdateItemInput , output: Result) + // The private method to be refined by the library developer + + + method UpdateItem ( config: InternalConfig , input: UpdateItemInput ) + 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 UpdateItemEnsuresPublicly(input, output) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/Cargo.toml b/TestModels/aws-sdks/ddb-lite/runtimes/rust/Cargo.toml new file mode 100644 index 0000000000..ff0f2840f8 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "ddb_lite" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +aws-smithy-runtime = {version = "1.6.0", features = ["client"] } +aws-smithy-runtime-api = {version = "1.7.0", features = ["client"] } +aws-smithy-types = "1.2.0" +dafny_runtime = { path = "../../../../dafny-dependencies/dafny_runtime_rust"} + +aws-sdk-dynamodb = "1.35.0" +aws-config = "1.5.4" + +[dependencies.tokio] +version = "1.26.0" +features = ["full"] + +[lib] +path = "src/implementation_from_dafny.rs" \ No newline at end of file diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/client.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/client.rs new file mode 100644 index 0000000000..eb39b2f15e --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/client.rs @@ -0,0 +1,165 @@ +// 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. +use crate::conversions; + +struct Client { + inner: aws_sdk_dynamodb::Client, + + rt: tokio::runtime::Runtime, +} + +impl dafny_runtime::UpcastObject for Client { + ::dafny_runtime::UpcastObjectFn!(dyn::std::any::Any); +} + +impl dafny_runtime::UpcastObject for Client { + ::dafny_runtime::UpcastObjectFn!(dyn crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient); +} + +impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient + for Client { + fn BatchGetItem(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::batch_get_item::_batch_get_item_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::batch_get_item::_batch_get_item_response::to_dafny, + conversions::batch_get_item::to_dafny_error) +} + fn CreateTable(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::create_table::_create_table_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::create_table::_create_table_response::to_dafny, + conversions::create_table::to_dafny_error) +} + fn DeleteItem(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::delete_item::_delete_item_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::delete_item::_delete_item_response::to_dafny, + conversions::delete_item::to_dafny_error) +} + fn DescribeTable(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::describe_table::_describe_table_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::describe_table::_describe_table_response::to_dafny, + conversions::describe_table::to_dafny_error) +} + fn GetItem(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::get_item::_get_item_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::get_item::_get_item_response::to_dafny, + conversions::get_item::to_dafny_error) +} + fn PutItem(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::put_item::_put_item_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::put_item::_put_item_response::to_dafny, + conversions::put_item::to_dafny_error) +} + fn Query(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::query::_query_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::query::_query_response::to_dafny, + conversions::query::to_dafny_error) +} + fn Scan(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::scan::_scan_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::scan::_scan_response::to_dafny, + conversions::scan::to_dafny_error) +} + fn TransactWriteItems(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::transact_write_items::_transact_write_items_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::transact_write_items::_transact_write_items_response::to_dafny, + conversions::transact_write_items::to_dafny_error) +} + fn UpdateItem(&mut self, input: &std::rc::Rc) + -> std::rc::Rc, + std::rc::Rc + > +> { + let native_result = + self.rt.block_on(conversions::update_item::_update_item_request::from_dafny(input.clone(), self.inner.clone()).send()); + crate::standard_library_conversions::result_to_dafny(&native_result, + conversions::update_item::_update_item_response::to_dafny, + conversions::update_item::to_dafny_error) +} } + +#[allow(non_snake_case)] +impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::_default { + pub fn DynamoDBClient() -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + ::dafny_runtime::Object, + ::std::rc::Rc + > + > { + let rt_result = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build(); + if rt_result.is_err() { + return conversions::error::to_opaque_error_result(rt_result.err()); + } + let rt = rt_result.unwrap(); + + let shared_config = rt.block_on(aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28())); + let inner = aws_sdk_dynamodb::Client::new(&shared_config); + let client = Client { inner, rt }; + let dafny_client = ::dafny_runtime::upcast_object()(::dafny_runtime::object::new(client)); + std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::Success { value: dafny_client }) + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions.rs new file mode 100644 index 0000000000..5e8873f7c4 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions.rs @@ -0,0 +1,132 @@ +// 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. +pub mod archival_summary; + + pub mod attribute_action; + + pub mod attribute_definition; + + pub mod attribute_value; + + pub mod attribute_value_update; + + pub mod batch_get_item; + + pub mod billing_mode; + + pub mod billing_mode_summary; + + pub mod cancellation_reason; + + pub mod capacity; + + pub mod comparison_operator; + + pub mod condition; + + pub mod condition_check; + + pub mod conditional_operator; + + pub mod consumed_capacity; + + pub mod create_table; + + pub mod delete; + + pub mod delete_item; + + pub mod describe_table; + + pub mod error; + + pub mod expected_attribute_value; + + pub mod get_item; + + pub mod global_secondary_index; + + pub mod global_secondary_index_description; + + pub mod index_status; + + pub mod item_collection_metrics; + + pub mod key_schema_element; + + pub mod key_type; + + pub mod keys_and_attributes; + + pub mod local_secondary_index; + + pub mod local_secondary_index_description; + + pub mod projection; + + pub mod projection_type; + + pub mod provisioned_throughput; + + pub mod provisioned_throughput_description; + + pub mod provisioned_throughput_override; + + pub mod put; + + pub mod put_item; + + pub mod query; + + pub mod replica_description; + + pub mod replica_global_secondary_index_description; + + pub mod replica_status; + + pub mod restore_summary; + + pub mod return_consumed_capacity; + + pub mod return_item_collection_metrics; + + pub mod return_value; + + pub mod return_values_on_condition_check_failure; + + pub mod scalar_attribute_type; + + pub mod scan; + + pub mod select; + + pub mod sse_description; + + pub mod sse_specification; + + pub mod sse_status; + + pub mod sse_type; + + pub mod stream_specification; + + pub mod stream_view_type; + + pub mod table_class; + + pub mod table_class_summary; + + pub mod table_description; + + pub mod table_status; + + pub mod tag; + + pub mod transact_write_item; + + pub mod transact_write_items; + + pub mod update; + + pub mod update_item; diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/archival_summary.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/archival_summary.rs new file mode 100644 index 0000000000..dbfb6ce3e3 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/archival_summary.rs @@ -0,0 +1,29 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ArchivalSummary, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ArchivalSummary::ArchivalSummary { + ArchivalDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.archival_date_time), + ArchivalReason: crate::standard_library_conversions::ostring_to_dafny(&value.archival_reason), + ArchivalBackupArn: crate::standard_library_conversions::ostring_to_dafny(&value.archival_backup_arn), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ArchivalSummary, + >, +) -> aws_sdk_dynamodb::types::ArchivalSummary { + aws_sdk_dynamodb::types::ArchivalSummary::builder() + .set_archival_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.ArchivalDateTime().clone())) + .set_archival_reason(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ArchivalReason().clone())) + .set_archival_backup_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ArchivalBackupArn().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_action.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_action.rs new file mode 100644 index 0000000000..3b4bb95a5e --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_action.rs @@ -0,0 +1,25 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::AttributeAction, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::AttributeAction::Add => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::ADD {}, + aws_sdk_dynamodb::types::AttributeAction::Put => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::PUT {}, + aws_sdk_dynamodb::types::AttributeAction::Delete => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::DELETE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction, +) -> aws_sdk_dynamodb::types::AttributeAction { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::ADD {} => aws_sdk_dynamodb::types::AttributeAction::Add, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::PUT {} => aws_sdk_dynamodb::types::AttributeAction::Put, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction::DELETE {} => aws_sdk_dynamodb::types::AttributeAction::Delete, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_definition.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_definition.rs new file mode 100644 index 0000000000..b4e5057f9c --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_definition.rs @@ -0,0 +1,27 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::AttributeDefinition, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition::AttributeDefinition { + AttributeName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.attribute_name), + AttributeType: crate::conversions::scalar_attribute_type::to_dafny(value.attribute_type.clone()), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition, + >, +) -> aws_sdk_dynamodb::types::AttributeDefinition { + aws_sdk_dynamodb::types::AttributeDefinition::builder() + .set_attribute_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.AttributeName()) )) + .set_attribute_type(Some( crate::conversions::scalar_attribute_type::from_dafny(dafny_value.AttributeType()) )) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value.rs new file mode 100644 index 0000000000..4db7583201 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value.rs @@ -0,0 +1,110 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::AttributeValue, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + match value { + aws_sdk_dynamodb::types::AttributeValue::B(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::B { + B: crate::standard_library_conversions::blob_to_dafny(x) + }, + aws_sdk_dynamodb::types::AttributeValue::Bool(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::BOOL { + BOOL: *x + }, + aws_sdk_dynamodb::types::AttributeValue::Bs(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::BS { + BS: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, crate::standard_library_conversions::blob_to_dafny) + }, + aws_sdk_dynamodb::types::AttributeValue::L(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::L { + L: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, to_dafny) + }, + aws_sdk_dynamodb::types::AttributeValue::M(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::M { + M: dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |s| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s), + to_dafny) + }, + aws_sdk_dynamodb::types::AttributeValue::N(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::N { + N: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&x) + }, + aws_sdk_dynamodb::types::AttributeValue::Ns(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::NS { + NS: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |s| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(s)) + }, + aws_sdk_dynamodb::types::AttributeValue::Null(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::NULL { + NULL: *x + }, + aws_sdk_dynamodb::types::AttributeValue::S(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::S { + S: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&x) + }, + aws_sdk_dynamodb::types::AttributeValue::Ss(x) => + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::SS { + SS: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |s| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(s)) + }, + _ => panic!("Unknown union variant: {:?}", value), + } + ) +} +#[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue, + >, +) -> aws_sdk_dynamodb::types::AttributeValue { + match &*dafny_value { + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::S { S } => + aws_sdk_dynamodb::types::AttributeValue::S( + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(S) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::N { N } => + aws_sdk_dynamodb::types::AttributeValue::N( + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(N) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::B { B } => + aws_sdk_dynamodb::types::AttributeValue::B( + crate::standard_library_conversions::blob_from_dafny(B.clone()) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::SS { SS } => + aws_sdk_dynamodb::types::AttributeValue::Ss( + dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(SS, + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::NS { NS } => + aws_sdk_dynamodb::types::AttributeValue::Ss( + dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(NS, + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::BS { BS } => + aws_sdk_dynamodb::types::AttributeValue::Bs( + dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(BS, + |b| crate::standard_library_conversions::blob_from_dafny(b.clone())) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::M { M } => + aws_sdk_dynamodb::types::AttributeValue::M( + dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(M, + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string, + |v| from_dafny(v.clone())) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::L { L } => + aws_sdk_dynamodb::types::AttributeValue::L( + dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(L, + |v| from_dafny(v.clone())) + ), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::NULL { NULL } => + aws_sdk_dynamodb::types::AttributeValue::Null(*NULL), + crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::BOOL { BOOL } => + aws_sdk_dynamodb::types::AttributeValue::Bool(*BOOL), + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value_update.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value_update.rs new file mode 100644 index 0000000000..947bffa84c --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/attribute_value_update.rs @@ -0,0 +1,46 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::AttributeValueUpdate, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValueUpdate::AttributeValueUpdate { + Value: ::std::rc::Rc::new(match &value.value { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::attribute_value::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Action: ::std::rc::Rc::new(match &value.action { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::attribute_action::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValueUpdate, + >, +) -> aws_sdk_dynamodb::types::AttributeValueUpdate { + aws_sdk_dynamodb::types::AttributeValueUpdate::builder() + .set_value(match (*dafny_value.Value()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::attribute_value::from_dafny(value.clone())), + _ => None, +} +) + .set_action(match &**dafny_value.Action() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::attribute_action::from_dafny(value) + ), + _ => None, +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item.rs new file mode 100644 index 0000000000..52d40b8c88 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item.rs @@ -0,0 +1,32 @@ +// 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. +pub mod _batch_get_item_request; + + pub mod _batch_get_item_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_request.rs new file mode 100644 index 0000000000..6c507c410f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_request.rs @@ -0,0 +1,45 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemInput::BatchGetItemInput { + RequestItems: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.request_items.clone().unwrap(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::keys_and_attributes::to_dafny(&v) +, +) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::batch_get_item::builders::BatchGetItemFluentBuilder { + client.batch_get_item() + .set_request_items(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.RequestItems(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::keys_and_attributes::from_dafny(v.clone()) +, +) + )) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_response.rs new file mode 100644 index 0000000000..8f39eed79a --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_get_item/_batch_get_item_response.rs @@ -0,0 +1,53 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::batch_get_item::BatchGetItemOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemOutput::BatchGetItemOutput { + Responses: +::std::rc::Rc::new(match &value.responses { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&v, + |e| ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&e.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, +) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + UnprocessedKeys: +::std::rc::Rc::new(match &value.unprocessed_keys { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::keys_and_attributes::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::consumed_capacity::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode.rs new file mode 100644 index 0000000000..5304c2abc0 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::BillingMode, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::BillingMode::Provisioned => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode::PROVISIONED {}, + aws_sdk_dynamodb::types::BillingMode::PayPerRequest => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode::PAY_PER_REQUEST {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode, +) -> aws_sdk_dynamodb::types::BillingMode { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode::PROVISIONED {} => aws_sdk_dynamodb::types::BillingMode::Provisioned, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode::PAY_PER_REQUEST {} => aws_sdk_dynamodb::types::BillingMode::PayPerRequest, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode_summary.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode_summary.rs new file mode 100644 index 0000000000..84a2b27e34 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/billing_mode_summary.rs @@ -0,0 +1,37 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::BillingModeSummary, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary::BillingModeSummary { + BillingMode: ::std::rc::Rc::new(match &value.billing_mode { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::billing_mode::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + LastUpdateToPayPerRequestDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.last_update_to_pay_per_request_date_time), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary, + >, +) -> aws_sdk_dynamodb::types::BillingModeSummary { + aws_sdk_dynamodb::types::BillingModeSummary::builder() + .set_billing_mode(match &**dafny_value.BillingMode() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::billing_mode::from_dafny(value) + ), + _ => None, +} +) + .set_last_update_to_pay_per_request_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.LastUpdateToPayPerRequestDateTime().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/cancellation_reason.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/cancellation_reason.rs new file mode 100644 index 0000000000..1a65910a06 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/cancellation_reason.rs @@ -0,0 +1,51 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::CancellationReason, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReason::CancellationReason { + Item: +::std::rc::Rc::new(match &value.item { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Code: crate::standard_library_conversions::ostring_to_dafny(&value.code), + Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReason, + >, +) -> aws_sdk_dynamodb::types::CancellationReason { + aws_sdk_dynamodb::types::CancellationReason::builder() + .set_item(match (*dafny_value.Item()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_code(crate::standard_library_conversions::ostring_from_dafny(dafny_value.Code().clone())) + .set_message(crate::standard_library_conversions::ostring_from_dafny(dafny_value.Message().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/capacity.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/capacity.rs new file mode 100644 index 0000000000..870454d793 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/capacity.rs @@ -0,0 +1,29 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Capacity, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity::Capacity { + ReadCapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.read_capacity_units), + WriteCapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.write_capacity_units), + CapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.capacity_units), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity, + >, +) -> aws_sdk_dynamodb::types::Capacity { + aws_sdk_dynamodb::types::Capacity::builder() + .set_read_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.ReadCapacityUnits().clone())) + .set_write_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.WriteCapacityUnits().clone())) + .set_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.CapacityUnits().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/comparison_operator.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/comparison_operator.rs new file mode 100644 index 0000000000..0c75159bda --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/comparison_operator.rs @@ -0,0 +1,45 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ComparisonOperator, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ComparisonOperator::Eq => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::EQ {}, + aws_sdk_dynamodb::types::ComparisonOperator::Ne => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NE {}, + aws_sdk_dynamodb::types::ComparisonOperator::In => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::IN {}, + aws_sdk_dynamodb::types::ComparisonOperator::Le => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::LE {}, + aws_sdk_dynamodb::types::ComparisonOperator::Lt => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::LT {}, + aws_sdk_dynamodb::types::ComparisonOperator::Ge => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::GE {}, + aws_sdk_dynamodb::types::ComparisonOperator::Gt => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::GT {}, + aws_sdk_dynamodb::types::ComparisonOperator::Between => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::BETWEEN {}, + aws_sdk_dynamodb::types::ComparisonOperator::NotNull => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NOT_NULL {}, + aws_sdk_dynamodb::types::ComparisonOperator::Null => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NULL {}, + aws_sdk_dynamodb::types::ComparisonOperator::Contains => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::CONTAINS {}, + aws_sdk_dynamodb::types::ComparisonOperator::NotContains => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NOT_CONTAINS {}, + aws_sdk_dynamodb::types::ComparisonOperator::BeginsWith => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::BEGINS_WITH {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator, +) -> aws_sdk_dynamodb::types::ComparisonOperator { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::EQ {} => aws_sdk_dynamodb::types::ComparisonOperator::Eq, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NE {} => aws_sdk_dynamodb::types::ComparisonOperator::Ne, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::IN {} => aws_sdk_dynamodb::types::ComparisonOperator::In, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::LE {} => aws_sdk_dynamodb::types::ComparisonOperator::Le, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::LT {} => aws_sdk_dynamodb::types::ComparisonOperator::Lt, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::GE {} => aws_sdk_dynamodb::types::ComparisonOperator::Ge, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::GT {} => aws_sdk_dynamodb::types::ComparisonOperator::Gt, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::BETWEEN {} => aws_sdk_dynamodb::types::ComparisonOperator::Between, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NOT_NULL {} => aws_sdk_dynamodb::types::ComparisonOperator::NotNull, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NULL {} => aws_sdk_dynamodb::types::ComparisonOperator::Null, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::CONTAINS {} => aws_sdk_dynamodb::types::ComparisonOperator::Contains, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::NOT_CONTAINS {} => aws_sdk_dynamodb::types::ComparisonOperator::NotContains, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator::BEGINS_WITH {} => aws_sdk_dynamodb::types::ComparisonOperator::BeginsWith, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition.rs new file mode 100644 index 0000000000..fe3c9985fb --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition.rs @@ -0,0 +1,46 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Condition, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition::Condition { + AttributeValueList: ::std::rc::Rc::new(match &value.attribute_value_list { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::attribute_value::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ComparisonOperator: crate::conversions::comparison_operator::to_dafny(value.comparison_operator.clone()), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition, + >, +) -> aws_sdk_dynamodb::types::Condition { + aws_sdk_dynamodb::types::Condition::builder() + .set_attribute_value_list(match (*dafny_value.AttributeValueList()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::attribute_value::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_comparison_operator(Some( crate::conversions::comparison_operator::from_dafny(dafny_value.ComparisonOperator()) )) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition_check.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition_check.rs new file mode 100644 index 0000000000..20d498cef8 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/condition_check.rs @@ -0,0 +1,97 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ConditionCheck, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck::ConditionCheck { + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + TableName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.table_name), + ConditionExpression: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck, + >, +) -> aws_sdk_dynamodb::types::ConditionCheck { + aws_sdk_dynamodb::types::ConditionCheck::builder() + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_condition_expression(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.ConditionExpression()) )) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/conditional_operator.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/conditional_operator.rs new file mode 100644 index 0000000000..64208da483 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/conditional_operator.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ConditionalOperator, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ConditionalOperator::And => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator::AND {}, + aws_sdk_dynamodb::types::ConditionalOperator::Or => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator::OR {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator, +) -> aws_sdk_dynamodb::types::ConditionalOperator { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator::AND {} => aws_sdk_dynamodb::types::ConditionalOperator::And, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator::OR {} => aws_sdk_dynamodb::types::ConditionalOperator::Or, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/consumed_capacity.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/consumed_capacity.rs new file mode 100644 index 0000000000..649ce3d6f1 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/consumed_capacity.rs @@ -0,0 +1,90 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ConsumedCapacity, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity::ConsumedCapacity { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name), + CapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.capacity_units), + ReadCapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.read_capacity_units), + WriteCapacityUnits: crate::standard_library_conversions::odouble_to_dafny(&value.write_capacity_units), + Table: ::std::rc::Rc::new(match &value.table { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + LocalSecondaryIndexes: +::std::rc::Rc::new(match &value.local_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::capacity::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + GlobalSecondaryIndexes: +::std::rc::Rc::new(match &value.global_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::capacity::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity, + >, +) -> aws_sdk_dynamodb::types::ConsumedCapacity { + aws_sdk_dynamodb::types::ConsumedCapacity::builder() + .set_table_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.TableName().clone())) + .set_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.CapacityUnits().clone())) + .set_read_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.ReadCapacityUnits().clone())) + .set_write_capacity_units(crate::standard_library_conversions::odouble_from_dafny(dafny_value.WriteCapacityUnits().clone())) + .set_table(match (*dafny_value.Table()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::capacity::from_dafny(value.clone())), + _ => None, +} +) + .set_local_secondary_indexes(match (*dafny_value.LocalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::capacity::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_global_secondary_indexes(match (*dafny_value.GlobalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::capacity::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table.rs new file mode 100644 index 0000000000..20182a5655 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table.rs @@ -0,0 +1,30 @@ +// 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. +pub mod _create_table_request; + + pub mod _create_table_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::create_table::CreateTableError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::create_table::CreateTableError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::create_table::CreateTableError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::create_table::CreateTableError::LimitExceededException(e) => + crate::conversions::error::limit_exceeded_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::create_table::CreateTableError::ResourceInUseException(e) => + crate::conversions::error::resource_in_use_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_request.rs new file mode 100644 index 0000000000..259378b91f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_request.rs @@ -0,0 +1,163 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::create_table::CreateTableInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableInput::CreateTableInput { + AttributeDefinitions: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.attribute_definitions.clone().unwrap(), + |e| crate::conversions::attribute_definition::to_dafny(&e) +, +) +, + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + KeySchema: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.key_schema.clone().unwrap(), + |e| crate::conversions::key_schema_element::to_dafny(&e) +, +) +, + LocalSecondaryIndexes: ::std::rc::Rc::new(match &value.local_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::local_secondary_index::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + GlobalSecondaryIndexes: ::std::rc::Rc::new(match &value.global_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::global_secondary_index::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + BillingMode: ::std::rc::Rc::new(match &value.billing_mode { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::billing_mode::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ProvisionedThroughput: ::std::rc::Rc::new(match &value.provisioned_throughput { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + StreamSpecification: ::std::rc::Rc::new(match &value.stream_specification { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::stream_specification::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + SSESpecification: ::std::rc::Rc::new(match &value.sse_specification { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::sse_specification::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Tags: ::std::rc::Rc::new(match &value.tags { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::tag::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + TableClass: ::std::rc::Rc::new(match &value.table_class { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_class::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::create_table::builders::CreateTableFluentBuilder { + client.create_table() + .set_attribute_definitions(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.AttributeDefinitions(), + |e| crate::conversions::attribute_definition::from_dafny(e.clone()) +, +) + )) + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_key_schema(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.KeySchema(), + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, +) + )) + .set_local_secondary_indexes(match (*dafny_value.LocalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::local_secondary_index::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_global_secondary_indexes(match (*dafny_value.GlobalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::global_secondary_index::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_billing_mode(match &**dafny_value.BillingMode() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::billing_mode::from_dafny(value) + ), + _ => None, +} +) + .set_provisioned_throughput(match (*dafny_value.ProvisionedThroughput()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput::from_dafny(value.clone())), + _ => None, +} +) + .set_stream_specification(match (*dafny_value.StreamSpecification()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::stream_specification::from_dafny(value.clone())), + _ => None, +} +) + .set_sse_specification(match (*dafny_value.SSESpecification()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::sse_specification::from_dafny(value.clone())), + _ => None, +} +) + .set_tags(match (*dafny_value.Tags()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::tag::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_table_class(match &**dafny_value.TableClass() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::table_class::from_dafny(value) + ), + _ => None, +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_response.rs new file mode 100644 index 0000000000..f0b7d7727f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/create_table/_create_table_response.rs @@ -0,0 +1,17 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::create_table::CreateTableOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableOutput::CreateTableOutput { + TableDescription: ::std::rc::Rc::new(match &value.table_description { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_description::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete.rs new file mode 100644 index 0000000000..42189a1439 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete.rs @@ -0,0 +1,97 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Delete, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Delete::Delete { + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + TableName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.table_name), + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Delete, + >, +) -> aws_sdk_dynamodb::types::Delete { + aws_sdk_dynamodb::types::Delete::builder() + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item.rs new file mode 100644 index 0000000000..c4f3b25c5d --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item.rs @@ -0,0 +1,38 @@ +// 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. +pub mod _delete_item_request; + + pub mod _delete_item_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::delete_item::DeleteItemError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::TransactionConflictException(e) => + crate::conversions::error::transaction_conflict_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::ConditionalCheckFailedException(e) => + crate::conversions::error::conditional_check_failed_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::ItemCollectionSizeLimitExceededException(e) => + crate::conversions::error::item_collection_size_limit_exceeded_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::delete_item::DeleteItemError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_request.rs new file mode 100644 index 0000000000..7f338ea978 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_request.rs @@ -0,0 +1,155 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::delete_item::DeleteItemInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemInput::DeleteItemInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone().unwrap(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + Expected: +::std::rc::Rc::new(match &value.expected { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::expected_attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConditionalOperator: ::std::rc::Rc::new(match &value.conditional_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::conditional_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnValues: ::std::rc::Rc::new(match &value.return_values { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_value::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnItemCollectionMetrics: ::std::rc::Rc::new(match &value.return_item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_item_collection_metrics::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::delete_item::builders::DeleteItemFluentBuilder { + client.delete_item() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_expected(match (*dafny_value.Expected()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::expected_attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_conditional_operator(match &**dafny_value.ConditionalOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::conditional_operator::from_dafny(value) + ), + _ => None, +} +) + .set_return_values(match &**dafny_value.ReturnValues() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_value::from_dafny(value) + ), + _ => None, +} +) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_return_item_collection_metrics(match &**dafny_value.ReturnItemCollectionMetrics() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_item_collection_metrics::from_dafny(value) + ), + _ => None, +} +) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_response.rs new file mode 100644 index 0000000000..89688aef65 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/delete_item/_delete_item_response.rs @@ -0,0 +1,34 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::delete_item::DeleteItemOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemOutput::DeleteItemOutput { + Attributes: +::std::rc::Rc::new(match &value.attributes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ItemCollectionMetrics: ::std::rc::Rc::new(match &value.item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::item_collection_metrics::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table.rs new file mode 100644 index 0000000000..ed39e12704 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table.rs @@ -0,0 +1,28 @@ +// 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. +pub mod _describe_table_request; + + pub mod _describe_table_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::describe_table::DescribeTableError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::describe_table::DescribeTableError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::describe_table::DescribeTableError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::describe_table::DescribeTableError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_request.rs new file mode 100644 index 0000000000..7050e028f6 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_request.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::describe_table::DescribeTableInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableInput::DescribeTableInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::describe_table::builders::DescribeTableFluentBuilder { + client.describe_table() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_response.rs new file mode 100644 index 0000000000..aaee97b525 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/describe_table/_describe_table_response.rs @@ -0,0 +1,17 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::describe_table::DescribeTableOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableOutput::DescribeTableOutput { + Table: ::std::rc::Rc::new(match &value.table { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_description::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error.rs new file mode 100644 index 0000000000..3d50f7a32c --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error.rs @@ -0,0 +1,57 @@ +// 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. +pub mod conditional_check_failed_exception; + + pub mod idempotent_parameter_mismatch_exception; + + pub mod internal_server_error; + + pub mod invalid_endpoint_exception; + + pub mod item_collection_size_limit_exceeded_exception; + + pub mod limit_exceeded_exception; + + pub mod provisioned_throughput_exceeded_exception; + + pub mod request_limit_exceeded; + + pub mod resource_in_use_exception; + + pub mod resource_not_found_exception; + + pub mod transaction_canceled_exception; + + pub mod transaction_conflict_exception; + + pub mod transaction_in_progress_exception; + /// Wraps up an arbitrary Rust Error value as a Dafny Error +pub fn to_opaque_error(value: E) -> + ::std::rc::Rc +{ + let error_obj: ::dafny_runtime::Object = ::dafny_runtime::Object(Some( + ::std::rc::Rc::new(::std::cell::UnsafeCell::new(value)), + )); + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::Opaque { + obj: error_obj, + }, + ) +} + +/// Wraps up an arbitrary Rust Error value as a Dafny Result.Failure +pub fn to_opaque_error_result(value: E) -> + ::std::rc::Rc< + crate::_Wrappers_Compile::Result< + T, + ::std::rc::Rc + > + > +{ + ::std::rc::Rc::new( + crate::_Wrappers_Compile::Result::Failure { + error: to_opaque_error(value), + }, + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/conditional_check_failed_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/conditional_check_failed_exception.rs new file mode 100644 index 0000000000..a7e3e12a25 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/conditional_check_failed_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::ConditionalCheckFailedException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ConditionalCheckFailedException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/idempotent_parameter_mismatch_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/idempotent_parameter_mismatch_exception.rs new file mode 100644 index 0000000000..6db298e080 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/idempotent_parameter_mismatch_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::IdempotentParameterMismatchException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::IdempotentParameterMismatchException { + Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/internal_server_error.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/internal_server_error.rs new file mode 100644 index 0000000000..3a5d7223aa --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/internal_server_error.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::InternalServerError, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::InternalServerError { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/invalid_endpoint_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/invalid_endpoint_exception.rs new file mode 100644 index 0000000000..8db39aba13 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/invalid_endpoint_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::InvalidEndpointException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::InvalidEndpointException { + Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/item_collection_size_limit_exceeded_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/item_collection_size_limit_exceeded_exception.rs new file mode 100644 index 0000000000..c109f66248 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/item_collection_size_limit_exceeded_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::ItemCollectionSizeLimitExceededException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ItemCollectionSizeLimitExceededException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/limit_exceeded_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/limit_exceeded_exception.rs new file mode 100644 index 0000000000..e912e0c17a --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/limit_exceeded_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::LimitExceededException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::LimitExceededException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/provisioned_throughput_exceeded_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/provisioned_throughput_exceeded_exception.rs new file mode 100644 index 0000000000..396cf1f8bc --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/provisioned_throughput_exceeded_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::ProvisionedThroughputExceededException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ProvisionedThroughputExceededException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/request_limit_exceeded.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/request_limit_exceeded.rs new file mode 100644 index 0000000000..f45ef374a3 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/request_limit_exceeded.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::RequestLimitExceeded, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::RequestLimitExceeded { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_in_use_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_in_use_exception.rs new file mode 100644 index 0000000000..1bcbcb1a62 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_in_use_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::ResourceInUseException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ResourceInUseException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_not_found_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_not_found_exception.rs new file mode 100644 index 0000000000..162fcfb3cb --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/resource_not_found_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::ResourceNotFoundException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ResourceNotFoundException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_canceled_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_canceled_exception.rs new file mode 100644 index 0000000000..7fb1176585 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_canceled_exception.rs @@ -0,0 +1,25 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::TransactionCanceledException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::TransactionCanceledException { + Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + CancellationReasons: ::std::rc::Rc::new(match &value.cancellation_reasons { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::cancellation_reason::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_conflict_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_conflict_exception.rs new file mode 100644 index 0000000000..d299616bc9 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_conflict_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::TransactionConflictException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::TransactionConflictException { + message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_in_progress_exception.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_in_progress_exception.rs new file mode 100644 index 0000000000..9622713d49 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/error/transaction_in_progress_exception.rs @@ -0,0 +1,15 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: aws_sdk_dynamodb::types::error::TransactionInProgressException, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::TransactionInProgressException { + Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + } + ) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/expected_attribute_value.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/expected_attribute_value.rs new file mode 100644 index 0000000000..8fff04a97d --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/expected_attribute_value.rs @@ -0,0 +1,69 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ExpectedAttributeValue, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue::ExpectedAttributeValue { + Value: ::std::rc::Rc::new(match &value.value { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::attribute_value::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Exists: crate::standard_library_conversions::obool_to_dafny(&value.exists), + ComparisonOperator: ::std::rc::Rc::new(match &value.comparison_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::comparison_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + AttributeValueList: ::std::rc::Rc::new(match &value.attribute_value_list { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::attribute_value::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue, + >, +) -> aws_sdk_dynamodb::types::ExpectedAttributeValue { + aws_sdk_dynamodb::types::ExpectedAttributeValue::builder() + .set_value(match (*dafny_value.Value()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::attribute_value::from_dafny(value.clone())), + _ => None, +} +) + .set_exists(crate::standard_library_conversions::obool_from_dafny(dafny_value.Exists().clone())) + .set_comparison_operator(match &**dafny_value.ComparisonOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::comparison_operator::from_dafny(value) + ), + _ => None, +} +) + .set_attribute_value_list(match (*dafny_value.AttributeValueList()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::attribute_value::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item.rs new file mode 100644 index 0000000000..fb441c8c0b --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item.rs @@ -0,0 +1,32 @@ +// 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. +pub mod _get_item_request; + + pub mod _get_item_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::get_item::GetItemError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::get_item::GetItemError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::get_item::GetItemError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::get_item::GetItemError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::get_item::GetItemError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::get_item::GetItemError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_request.rs new file mode 100644 index 0000000000..55d0d575d9 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_request.rs @@ -0,0 +1,92 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::get_item::GetItemInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemInput::GetItemInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone().unwrap(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + AttributesToGet: ::std::rc::Rc::new(match &value.attributes_to_get { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsistentRead: crate::standard_library_conversions::obool_to_dafny(&value.consistent_read), + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ProjectionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.projection_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::get_item::builders::GetItemFluentBuilder { + client.get_item() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_attributes_to_get(match (*dafny_value.AttributesToGet()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), + ) + ), + _ => None +} +) + .set_consistent_read(crate::standard_library_conversions::obool_from_dafny(dafny_value.ConsistentRead().clone())) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_projection_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ProjectionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_response.rs new file mode 100644 index 0000000000..afe4c09e70 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/get_item/_get_item_response.rs @@ -0,0 +1,29 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::get_item::GetItemOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemOutput::GetItemOutput { + Item: +::std::rc::Rc::new(match &value.item { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index.rs new file mode 100644 index 0000000000..e9f0792c45 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index.rs @@ -0,0 +1,50 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::GlobalSecondaryIndex, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.index_name), + KeySchema: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.key_schema, + |e| crate::conversions::key_schema_element::to_dafny(&e) +, +) +, + Projection: crate::conversions::projection::to_dafny(&value.projection.clone().unwrap()) +, + ProvisionedThroughput: ::std::rc::Rc::new(match &value.provisioned_throughput { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex, + >, +) -> aws_sdk_dynamodb::types::GlobalSecondaryIndex { + aws_sdk_dynamodb::types::GlobalSecondaryIndex::builder() + .set_index_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.IndexName()) )) + .set_key_schema(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.KeySchema(), + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, +) + )) + .set_projection(Some( crate::conversions::projection::from_dafny(dafny_value.Projection().clone()) + )) + .set_provisioned_throughput(match (*dafny_value.ProvisionedThroughput()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput::from_dafny(value.clone())), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index_description.rs new file mode 100644 index 0000000000..fea5eb404b --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/global_secondary_index_description.rs @@ -0,0 +1,88 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::GlobalSecondaryIndexDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription { + IndexName: crate::standard_library_conversions::ostring_to_dafny(&value.index_name), + KeySchema: ::std::rc::Rc::new(match &value.key_schema { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::key_schema_element::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Projection: ::std::rc::Rc::new(match &value.projection { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::projection::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + IndexStatus: ::std::rc::Rc::new(match &value.index_status { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::index_status::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Backfilling: crate::standard_library_conversions::obool_to_dafny(&value.backfilling), + ProvisionedThroughput: ::std::rc::Rc::new(match &value.provisioned_throughput { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput_description::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + IndexSizeBytes: crate::standard_library_conversions::olong_to_dafny(&value.index_size_bytes), + ItemCount: crate::standard_library_conversions::olong_to_dafny(&value.item_count), + IndexArn: crate::standard_library_conversions::ostring_to_dafny(&value.index_arn), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexDescription, + >, +) -> aws_sdk_dynamodb::types::GlobalSecondaryIndexDescription { + aws_sdk_dynamodb::types::GlobalSecondaryIndexDescription::builder() + .set_index_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexName().clone())) + .set_key_schema(match (*dafny_value.KeySchema()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_projection(match (*dafny_value.Projection()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::projection::from_dafny(value.clone())), + _ => None, +} +) + .set_index_status(match &**dafny_value.IndexStatus() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::index_status::from_dafny(value) + ), + _ => None, +} +) + .set_backfilling(crate::standard_library_conversions::obool_from_dafny(dafny_value.Backfilling().clone())) + .set_provisioned_throughput(match (*dafny_value.ProvisionedThroughput()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput_description::from_dafny(value.clone())), + _ => None, +} +) + .set_index_size_bytes(crate::standard_library_conversions::olong_from_dafny(dafny_value.IndexSizeBytes().clone())) + .set_item_count(crate::standard_library_conversions::olong_from_dafny(dafny_value.ItemCount().clone())) + .set_index_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexArn().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/index_status.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/index_status.rs new file mode 100644 index 0000000000..cd99dab3d6 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/index_status.rs @@ -0,0 +1,27 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::IndexStatus, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::IndexStatus::Creating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::CREATING {}, + aws_sdk_dynamodb::types::IndexStatus::Updating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::UPDATING {}, + aws_sdk_dynamodb::types::IndexStatus::Deleting => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::DELETING {}, + aws_sdk_dynamodb::types::IndexStatus::Active => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::ACTIVE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus, +) -> aws_sdk_dynamodb::types::IndexStatus { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::CREATING {} => aws_sdk_dynamodb::types::IndexStatus::Creating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::UPDATING {} => aws_sdk_dynamodb::types::IndexStatus::Updating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::DELETING {} => aws_sdk_dynamodb::types::IndexStatus::Deleting, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus::ACTIVE {} => aws_sdk_dynamodb::types::IndexStatus::Active, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/item_collection_metrics.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/item_collection_metrics.rs new file mode 100644 index 0000000000..d368b893f4 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/item_collection_metrics.rs @@ -0,0 +1,66 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ItemCollectionMetrics, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey: +::std::rc::Rc::new(match &value.item_collection_key { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + SizeEstimateRangeGB: ::std::rc::Rc::new(match &value.size_estimate_range_gb { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::standard_library_conversions::double_to_dafny(*e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics, + >, +) -> aws_sdk_dynamodb::types::ItemCollectionMetrics { + aws_sdk_dynamodb::types::ItemCollectionMetrics::builder() + .set_item_collection_key(match (*dafny_value.ItemCollectionKey()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_size_estimate_range_gb(match (*dafny_value.SizeEstimateRangeGB()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::standard_library_conversions::double_from_dafny(&e.clone()), + ) + ), + _ => None +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_schema_element.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_schema_element.rs new file mode 100644 index 0000000000..f1830b0c89 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_schema_element.rs @@ -0,0 +1,27 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::KeySchemaElement, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchemaElement::KeySchemaElement { + AttributeName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.attribute_name), + KeyType: crate::conversions::key_type::to_dafny(value.key_type.clone()), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchemaElement, + >, +) -> aws_sdk_dynamodb::types::KeySchemaElement { + aws_sdk_dynamodb::types::KeySchemaElement::builder() + .set_attribute_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.AttributeName()) )) + .set_key_type(Some( crate::conversions::key_type::from_dafny(dafny_value.KeyType()) )) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_type.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_type.rs new file mode 100644 index 0000000000..0d5d59c569 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/key_type.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::KeyType, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::KeyType::Hash => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType::HASH {}, + aws_sdk_dynamodb::types::KeyType::Range => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType::RANGE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType, +) -> aws_sdk_dynamodb::types::KeyType { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType::HASH {} => aws_sdk_dynamodb::types::KeyType::Hash, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType::RANGE {} => aws_sdk_dynamodb::types::KeyType::Range, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/keys_and_attributes.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/keys_and_attributes.rs new file mode 100644 index 0000000000..53a49562fa --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/keys_and_attributes.rs @@ -0,0 +1,86 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::KeysAndAttributes, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeysAndAttributes::KeysAndAttributes { + Keys: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.keys, + |e| ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&e.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, +) +, + AttributesToGet: ::std::rc::Rc::new(match &value.attributes_to_get { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsistentRead: crate::standard_library_conversions::obool_to_dafny(&value.consistent_read), + ProjectionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.projection_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::KeysAndAttributes, + >, +) -> aws_sdk_dynamodb::types::KeysAndAttributes { + aws_sdk_dynamodb::types::KeysAndAttributes::builder() + .set_keys(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.Keys(), + |e| ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&e, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) +, +) + )) + .set_attributes_to_get(match (*dafny_value.AttributesToGet()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), + ) + ), + _ => None +} +) + .set_consistent_read(crate::standard_library_conversions::obool_from_dafny(dafny_value.ConsistentRead().clone())) + .set_projection_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ProjectionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index.rs new file mode 100644 index 0000000000..8ace75441f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index.rs @@ -0,0 +1,39 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::LocalSecondaryIndex, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex::LocalSecondaryIndex { + IndexName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.index_name), + KeySchema: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.key_schema, + |e| crate::conversions::key_schema_element::to_dafny(&e) +, +) +, + Projection: crate::conversions::projection::to_dafny(&value.projection.clone().unwrap()) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex, + >, +) -> aws_sdk_dynamodb::types::LocalSecondaryIndex { + aws_sdk_dynamodb::types::LocalSecondaryIndex::builder() + .set_index_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.IndexName()) )) + .set_key_schema(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.KeySchema(), + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, +) + )) + .set_projection(Some( crate::conversions::projection::from_dafny(dafny_value.Projection().clone()) + )) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index_description.rs new file mode 100644 index 0000000000..7f84e73538 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/local_secondary_index_description.rs @@ -0,0 +1,63 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::LocalSecondaryIndexDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexDescription::LocalSecondaryIndexDescription { + IndexName: crate::standard_library_conversions::ostring_to_dafny(&value.index_name), + KeySchema: ::std::rc::Rc::new(match &value.key_schema { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::key_schema_element::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Projection: ::std::rc::Rc::new(match &value.projection { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::projection::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + IndexSizeBytes: crate::standard_library_conversions::olong_to_dafny(&value.index_size_bytes), + ItemCount: crate::standard_library_conversions::olong_to_dafny(&value.item_count), + IndexArn: crate::standard_library_conversions::ostring_to_dafny(&value.index_arn), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexDescription, + >, +) -> aws_sdk_dynamodb::types::LocalSecondaryIndexDescription { + aws_sdk_dynamodb::types::LocalSecondaryIndexDescription::builder() + .set_index_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexName().clone())) + .set_key_schema(match (*dafny_value.KeySchema()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_projection(match (*dafny_value.Projection()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::projection::from_dafny(value.clone())), + _ => None, +} +) + .set_index_size_bytes(crate::standard_library_conversions::olong_from_dafny(dafny_value.IndexSizeBytes().clone())) + .set_item_count(crate::standard_library_conversions::olong_from_dafny(dafny_value.ItemCount().clone())) + .set_index_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexArn().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection.rs new file mode 100644 index 0000000000..292ba3703d --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection.rs @@ -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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Projection, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection::Projection { + ProjectionType: ::std::rc::Rc::new(match &value.projection_type { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::projection_type::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + NonKeyAttributes: ::std::rc::Rc::new(match &value.non_key_attributes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection, + >, +) -> aws_sdk_dynamodb::types::Projection { + aws_sdk_dynamodb::types::Projection::builder() + .set_projection_type(match &**dafny_value.ProjectionType() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::projection_type::from_dafny(value) + ), + _ => None, +} +) + .set_non_key_attributes(match (*dafny_value.NonKeyAttributes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), + ) + ), + _ => None +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection_type.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection_type.rs new file mode 100644 index 0000000000..d242c07d48 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/projection_type.rs @@ -0,0 +1,25 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ProjectionType, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ProjectionType::All => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::ALL {}, + aws_sdk_dynamodb::types::ProjectionType::KeysOnly => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::KEYS_ONLY {}, + aws_sdk_dynamodb::types::ProjectionType::Include => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::INCLUDE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType, +) -> aws_sdk_dynamodb::types::ProjectionType { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::ALL {} => aws_sdk_dynamodb::types::ProjectionType::All, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::KEYS_ONLY {} => aws_sdk_dynamodb::types::ProjectionType::KeysOnly, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType::INCLUDE {} => aws_sdk_dynamodb::types::ProjectionType::Include, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput.rs new file mode 100644 index 0000000000..5417b77752 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput.rs @@ -0,0 +1,27 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ProvisionedThroughput, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits: value.read_capacity_units, + WriteCapacityUnits: value.write_capacity_units, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput, + >, +) -> aws_sdk_dynamodb::types::ProvisionedThroughput { + aws_sdk_dynamodb::types::ProvisionedThroughput::builder() + .set_read_capacity_units(Some( dafny_value.ReadCapacityUnits() .clone())) + .set_write_capacity_units(Some( dafny_value.WriteCapacityUnits() .clone())) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_description.rs new file mode 100644 index 0000000000..13f49bad51 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_description.rs @@ -0,0 +1,33 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ProvisionedThroughputDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription::ProvisionedThroughputDescription { + LastIncreaseDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.last_increase_date_time), + LastDecreaseDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.last_decrease_date_time), + NumberOfDecreasesToday: crate::standard_library_conversions::olong_to_dafny(&value.number_of_decreases_today), + ReadCapacityUnits: crate::standard_library_conversions::olong_to_dafny(&value.read_capacity_units), + WriteCapacityUnits: crate::standard_library_conversions::olong_to_dafny(&value.write_capacity_units), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription, + >, +) -> aws_sdk_dynamodb::types::ProvisionedThroughputDescription { + aws_sdk_dynamodb::types::ProvisionedThroughputDescription::builder() + .set_last_increase_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.LastIncreaseDateTime().clone())) + .set_last_decrease_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.LastDecreaseDateTime().clone())) + .set_number_of_decreases_today(crate::standard_library_conversions::olong_from_dafny(dafny_value.NumberOfDecreasesToday().clone())) + .set_read_capacity_units(crate::standard_library_conversions::olong_from_dafny(dafny_value.ReadCapacityUnits().clone())) + .set_write_capacity_units(crate::standard_library_conversions::olong_from_dafny(dafny_value.WriteCapacityUnits().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_override.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_override.rs new file mode 100644 index 0000000000..4434d06856 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/provisioned_throughput_override.rs @@ -0,0 +1,25 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ProvisionedThroughputOverride, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride::ProvisionedThroughputOverride { + ReadCapacityUnits: crate::standard_library_conversions::olong_to_dafny(&value.read_capacity_units), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride, + >, +) -> aws_sdk_dynamodb::types::ProvisionedThroughputOverride { + aws_sdk_dynamodb::types::ProvisionedThroughputOverride::builder() + .set_read_capacity_units(crate::standard_library_conversions::olong_from_dafny(dafny_value.ReadCapacityUnits().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put.rs new file mode 100644 index 0000000000..73cdadd1f1 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put.rs @@ -0,0 +1,97 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Put, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Put::Put { + Item: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.item.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + TableName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.table_name), + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Put, + >, +) -> aws_sdk_dynamodb::types::Put { + aws_sdk_dynamodb::types::Put::builder() + .set_item(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Item(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item.rs new file mode 100644 index 0000000000..aa5d963eab --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item.rs @@ -0,0 +1,38 @@ +// 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. +pub mod _put_item_request; + + pub mod _put_item_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::put_item::PutItemError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::put_item::PutItemError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::TransactionConflictException(e) => + crate::conversions::error::transaction_conflict_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::ConditionalCheckFailedException(e) => + crate::conversions::error::conditional_check_failed_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::ItemCollectionSizeLimitExceededException(e) => + crate::conversions::error::item_collection_size_limit_exceeded_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::put_item::PutItemError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_request.rs new file mode 100644 index 0000000000..84f7ae8ff9 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_request.rs @@ -0,0 +1,155 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::put_item::PutItemInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemInput::PutItemInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + Item: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.item.clone().unwrap(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + Expected: +::std::rc::Rc::new(match &value.expected { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::expected_attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnValues: ::std::rc::Rc::new(match &value.return_values { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_value::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnItemCollectionMetrics: ::std::rc::Rc::new(match &value.return_item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_item_collection_metrics::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ConditionalOperator: ::std::rc::Rc::new(match &value.conditional_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::conditional_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::put_item::builders::PutItemFluentBuilder { + client.put_item() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_item(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Item(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_expected(match (*dafny_value.Expected()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::expected_attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_values(match &**dafny_value.ReturnValues() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_value::from_dafny(value) + ), + _ => None, +} +) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_return_item_collection_metrics(match &**dafny_value.ReturnItemCollectionMetrics() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_item_collection_metrics::from_dafny(value) + ), + _ => None, +} +) + .set_conditional_operator(match &**dafny_value.ConditionalOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::conditional_operator::from_dafny(value) + ), + _ => None, +} +) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_response.rs new file mode 100644 index 0000000000..5de8d6dd52 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/put_item/_put_item_response.rs @@ -0,0 +1,34 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::put_item::PutItemOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemOutput::PutItemOutput { + Attributes: +::std::rc::Rc::new(match &value.attributes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ItemCollectionMetrics: ::std::rc::Rc::new(match &value.item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::item_collection_metrics::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query.rs new file mode 100644 index 0000000000..6673b429da --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query.rs @@ -0,0 +1,32 @@ +// 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. +pub mod _query_request; + + pub mod _query_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::query::QueryError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::query::QueryError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::query::QueryError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::query::QueryError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::query::QueryError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::query::QueryError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_request.rs new file mode 100644 index 0000000000..3bfac14c0a --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_request.rs @@ -0,0 +1,210 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::query::QueryInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryInput::QueryInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + IndexName: crate::standard_library_conversions::ostring_to_dafny(&value.index_name), + Select: ::std::rc::Rc::new(match &value.select { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::select::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + AttributesToGet: ::std::rc::Rc::new(match &value.attributes_to_get { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Limit: crate::standard_library_conversions::oint_to_dafny(value.limit), + ConsistentRead: crate::standard_library_conversions::obool_to_dafny(&value.consistent_read), + KeyConditions: +::std::rc::Rc::new(match &value.key_conditions { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::condition::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + QueryFilter: +::std::rc::Rc::new(match &value.query_filter { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::condition::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConditionalOperator: ::std::rc::Rc::new(match &value.conditional_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::conditional_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ScanIndexForward: crate::standard_library_conversions::obool_to_dafny(&value.scan_index_forward), + ExclusiveStartKey: +::std::rc::Rc::new(match &value.exclusive_start_key { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ProjectionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.projection_expression), + FilterExpression: crate::standard_library_conversions::ostring_to_dafny(&value.filter_expression), + KeyConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.key_condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::query::builders::QueryFluentBuilder { + client.query() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_index_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexName().clone())) + .set_select(match &**dafny_value.Select() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::select::from_dafny(value) + ), + _ => None, +} +) + .set_attributes_to_get(match (*dafny_value.AttributesToGet()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), + ) + ), + _ => None +} +) + .set_limit(crate::standard_library_conversions::oint_from_dafny(dafny_value.Limit().clone())) + .set_consistent_read(crate::standard_library_conversions::obool_from_dafny(dafny_value.ConsistentRead().clone())) + .set_key_conditions(match (*dafny_value.KeyConditions()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::condition::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_query_filter(match (*dafny_value.QueryFilter()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::condition::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_conditional_operator(match &**dafny_value.ConditionalOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::conditional_operator::from_dafny(value) + ), + _ => None, +} +) + .set_scan_index_forward(crate::standard_library_conversions::obool_from_dafny(dafny_value.ScanIndexForward().clone())) + .set_exclusive_start_key(match (*dafny_value.ExclusiveStartKey()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_projection_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ProjectionExpression().clone())) + .set_filter_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.FilterExpression().clone())) + .set_key_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.KeyConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_response.rs new file mode 100644 index 0000000000..a889435a13 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/query/_query_response.rs @@ -0,0 +1,45 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::query::QueryOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput::QueryOutput { + Items: ::std::rc::Rc::new(match &value.items { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&e.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Count: crate::standard_library_conversions::oint_to_dafny(Some(value.count)), + ScannedCount: crate::standard_library_conversions::oint_to_dafny(Some(value.scanned_count)), + LastEvaluatedKey: +::std::rc::Rc::new(match &value.last_evaluated_key { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_description.rs new file mode 100644 index 0000000000..290a505980 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_description.rs @@ -0,0 +1,88 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ReplicaDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription::ReplicaDescription { + RegionName: crate::standard_library_conversions::ostring_to_dafny(&value.region_name), + ReplicaStatus: ::std::rc::Rc::new(match &value.replica_status { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::replica_status::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReplicaStatusDescription: crate::standard_library_conversions::ostring_to_dafny(&value.replica_status_description), + ReplicaStatusPercentProgress: crate::standard_library_conversions::ostring_to_dafny(&value.replica_status_percent_progress), + KMSMasterKeyId: crate::standard_library_conversions::ostring_to_dafny(&value.kms_master_key_id), + ProvisionedThroughputOverride: ::std::rc::Rc::new(match &value.provisioned_throughput_override { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput_override::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + GlobalSecondaryIndexes: ::std::rc::Rc::new(match &value.global_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::replica_global_secondary_index_description::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReplicaInaccessibleDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.replica_inaccessible_date_time), + ReplicaTableClassSummary: ::std::rc::Rc::new(match &value.replica_table_class_summary { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_class_summary::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription, + >, +) -> aws_sdk_dynamodb::types::ReplicaDescription { + aws_sdk_dynamodb::types::ReplicaDescription::builder() + .set_region_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.RegionName().clone())) + .set_replica_status(match &**dafny_value.ReplicaStatus() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::replica_status::from_dafny(value) + ), + _ => None, +} +) + .set_replica_status_description(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ReplicaStatusDescription().clone())) + .set_replica_status_percent_progress(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ReplicaStatusPercentProgress().clone())) + .set_kms_master_key_id(crate::standard_library_conversions::ostring_from_dafny(dafny_value.KMSMasterKeyId().clone())) + .set_provisioned_throughput_override(match (*dafny_value.ProvisionedThroughputOverride()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput_override::from_dafny(value.clone())), + _ => None, +} +) + .set_global_secondary_indexes(match (*dafny_value.GlobalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::replica_global_secondary_index_description::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_replica_inaccessible_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.ReplicaInaccessibleDateTime().clone())) + .set_replica_table_class_summary(match (*dafny_value.ReplicaTableClassSummary()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::table_class_summary::from_dafny(value.clone())), + _ => None, +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_global_secondary_index_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_global_secondary_index_description.rs new file mode 100644 index 0000000000..91cdd11be0 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_global_secondary_index_description.rs @@ -0,0 +1,36 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::ReplicaGlobalSecondaryIndexDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription { + IndexName: crate::standard_library_conversions::ostring_to_dafny(&value.index_name), + ProvisionedThroughputOverride: ::std::rc::Rc::new(match &value.provisioned_throughput_override { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput_override::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexDescription, + >, +) -> aws_sdk_dynamodb::types::ReplicaGlobalSecondaryIndexDescription { + aws_sdk_dynamodb::types::ReplicaGlobalSecondaryIndexDescription::builder() + .set_index_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexName().clone())) + .set_provisioned_throughput_override(match (*dafny_value.ProvisionedThroughputOverride()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput_override::from_dafny(value.clone())), + _ => None, +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_status.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_status.rs new file mode 100644 index 0000000000..11e2638d48 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/replica_status.rs @@ -0,0 +1,33 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ReplicaStatus, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ReplicaStatus::Creating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::CREATING {}, + aws_sdk_dynamodb::types::ReplicaStatus::CreationFailed => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::CREATION_FAILED {}, + aws_sdk_dynamodb::types::ReplicaStatus::Updating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::UPDATING {}, + aws_sdk_dynamodb::types::ReplicaStatus::Deleting => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::DELETING {}, + aws_sdk_dynamodb::types::ReplicaStatus::Active => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::ACTIVE {}, + aws_sdk_dynamodb::types::ReplicaStatus::RegionDisabled => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::REGION_DISABLED {}, + aws_sdk_dynamodb::types::ReplicaStatus::InaccessibleEncryptionCredentials => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus, +) -> aws_sdk_dynamodb::types::ReplicaStatus { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::CREATING {} => aws_sdk_dynamodb::types::ReplicaStatus::Creating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::CREATION_FAILED {} => aws_sdk_dynamodb::types::ReplicaStatus::CreationFailed, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::UPDATING {} => aws_sdk_dynamodb::types::ReplicaStatus::Updating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::DELETING {} => aws_sdk_dynamodb::types::ReplicaStatus::Deleting, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::ACTIVE {} => aws_sdk_dynamodb::types::ReplicaStatus::Active, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::REGION_DISABLED {} => aws_sdk_dynamodb::types::ReplicaStatus::RegionDisabled, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {} => aws_sdk_dynamodb::types::ReplicaStatus::InaccessibleEncryptionCredentials, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/restore_summary.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/restore_summary.rs new file mode 100644 index 0000000000..1b40f2fc69 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/restore_summary.rs @@ -0,0 +1,31 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::RestoreSummary, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreSummary::RestoreSummary { + SourceBackupArn: crate::standard_library_conversions::ostring_to_dafny(&value.source_backup_arn), + SourceTableArn: crate::standard_library_conversions::ostring_to_dafny(&value.source_table_arn), + RestoreDateTime: crate::standard_library_conversions::timestamp_to_dafny(&value.restore_date_time), + RestoreInProgress: value.restore_in_progress, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreSummary, + >, +) -> aws_sdk_dynamodb::types::RestoreSummary { + aws_sdk_dynamodb::types::RestoreSummary::builder() + .set_source_backup_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.SourceBackupArn().clone())) + .set_source_table_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.SourceTableArn().clone())) + .set_restore_date_time(Some(crate::standard_library_conversions::timestamp_from_dafny(dafny_value.RestoreDateTime().clone()))) + .set_restore_in_progress(Some( dafny_value.RestoreInProgress() .clone())) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_consumed_capacity.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_consumed_capacity.rs new file mode 100644 index 0000000000..fbfeeb4e61 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_consumed_capacity.rs @@ -0,0 +1,25 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ReturnConsumedCapacity, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ReturnConsumedCapacity::Indexes => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::INDEXES {}, + aws_sdk_dynamodb::types::ReturnConsumedCapacity::Total => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::TOTAL {}, + aws_sdk_dynamodb::types::ReturnConsumedCapacity::None => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::NONE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity, +) -> aws_sdk_dynamodb::types::ReturnConsumedCapacity { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::INDEXES {} => aws_sdk_dynamodb::types::ReturnConsumedCapacity::Indexes, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::TOTAL {} => aws_sdk_dynamodb::types::ReturnConsumedCapacity::Total, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity::NONE {} => aws_sdk_dynamodb::types::ReturnConsumedCapacity::None, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_item_collection_metrics.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_item_collection_metrics.rs new file mode 100644 index 0000000000..0896dc4cd3 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_item_collection_metrics.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ReturnItemCollectionMetrics, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ReturnItemCollectionMetrics::Size => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics::SIZE {}, + aws_sdk_dynamodb::types::ReturnItemCollectionMetrics::None => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics::NONE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics, +) -> aws_sdk_dynamodb::types::ReturnItemCollectionMetrics { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics::SIZE {} => aws_sdk_dynamodb::types::ReturnItemCollectionMetrics::Size, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics::NONE {} => aws_sdk_dynamodb::types::ReturnItemCollectionMetrics::None, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_value.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_value.rs new file mode 100644 index 0000000000..21983ab80f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_value.rs @@ -0,0 +1,29 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ReturnValue, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ReturnValue::None => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::NONE {}, + aws_sdk_dynamodb::types::ReturnValue::AllOld => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::ALL_OLD {}, + aws_sdk_dynamodb::types::ReturnValue::UpdatedOld => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::UPDATED_OLD {}, + aws_sdk_dynamodb::types::ReturnValue::AllNew => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::ALL_NEW {}, + aws_sdk_dynamodb::types::ReturnValue::UpdatedNew => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::UPDATED_NEW {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue, +) -> aws_sdk_dynamodb::types::ReturnValue { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::NONE {} => aws_sdk_dynamodb::types::ReturnValue::None, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::ALL_OLD {} => aws_sdk_dynamodb::types::ReturnValue::AllOld, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::UPDATED_OLD {} => aws_sdk_dynamodb::types::ReturnValue::UpdatedOld, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::ALL_NEW {} => aws_sdk_dynamodb::types::ReturnValue::AllNew, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue::UPDATED_NEW {} => aws_sdk_dynamodb::types::ReturnValue::UpdatedNew, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_values_on_condition_check_failure.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_values_on_condition_check_failure.rs new file mode 100644 index 0000000000..b185462326 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/return_values_on_condition_check_failure.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure::AllOld => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure::ALL_OLD {}, + aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure::None => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure::NONE {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure, +) -> aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure::ALL_OLD {} => aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure::AllOld, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure::NONE {} => aws_sdk_dynamodb::types::ReturnValuesOnConditionCheckFailure::None, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scalar_attribute_type.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scalar_attribute_type.rs new file mode 100644 index 0000000000..7a16ac8159 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scalar_attribute_type.rs @@ -0,0 +1,25 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::ScalarAttributeType, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::ScalarAttributeType::S => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::S {}, + aws_sdk_dynamodb::types::ScalarAttributeType::N => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::N {}, + aws_sdk_dynamodb::types::ScalarAttributeType::B => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::B {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType, +) -> aws_sdk_dynamodb::types::ScalarAttributeType { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::S {} => aws_sdk_dynamodb::types::ScalarAttributeType::S, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::N {} => aws_sdk_dynamodb::types::ScalarAttributeType::N, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType::B {} => aws_sdk_dynamodb::types::ScalarAttributeType::B, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan.rs new file mode 100644 index 0000000000..f514ce7a66 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan.rs @@ -0,0 +1,32 @@ +// 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. +pub mod _scan_request; + + pub mod _scan_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::scan::ScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::scan::ScanError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::scan::ScanError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::scan::ScanError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::scan::ScanError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::scan::ScanError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_request.rs new file mode 100644 index 0000000000..9862067222 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_request.rs @@ -0,0 +1,186 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::scan::ScanInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanInput::ScanInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + IndexName: crate::standard_library_conversions::ostring_to_dafny(&value.index_name), + AttributesToGet: ::std::rc::Rc::new(match &value.attributes_to_get { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Limit: crate::standard_library_conversions::oint_to_dafny(value.limit), + Select: ::std::rc::Rc::new(match &value.select { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::select::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ScanFilter: +::std::rc::Rc::new(match &value.scan_filter { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::condition::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConditionalOperator: ::std::rc::Rc::new(match &value.conditional_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::conditional_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ExclusiveStartKey: +::std::rc::Rc::new(match &value.exclusive_start_key { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + TotalSegments: crate::standard_library_conversions::oint_to_dafny(value.total_segments), + Segment: crate::standard_library_conversions::oint_to_dafny(value.segment), + ProjectionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.projection_expression), + FilterExpression: crate::standard_library_conversions::ostring_to_dafny(&value.filter_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsistentRead: crate::standard_library_conversions::obool_to_dafny(&value.consistent_read), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::scan::builders::ScanFluentBuilder { + client.scan() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_index_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.IndexName().clone())) + .set_attributes_to_get(match (*dafny_value.AttributesToGet()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), + ) + ), + _ => None +} +) + .set_limit(crate::standard_library_conversions::oint_from_dafny(dafny_value.Limit().clone())) + .set_select(match &**dafny_value.Select() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::select::from_dafny(value) + ), + _ => None, +} +) + .set_scan_filter(match (*dafny_value.ScanFilter()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::condition::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_conditional_operator(match &**dafny_value.ConditionalOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::conditional_operator::from_dafny(value) + ), + _ => None, +} +) + .set_exclusive_start_key(match (*dafny_value.ExclusiveStartKey()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_total_segments(crate::standard_library_conversions::oint_from_dafny(dafny_value.TotalSegments().clone())) + .set_segment(crate::standard_library_conversions::oint_from_dafny(dafny_value.Segment().clone())) + .set_projection_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ProjectionExpression().clone())) + .set_filter_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.FilterExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_consistent_read(crate::standard_library_conversions::obool_from_dafny(dafny_value.ConsistentRead().clone())) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_response.rs new file mode 100644 index 0000000000..a568e4df17 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/scan/_scan_response.rs @@ -0,0 +1,45 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::scan::ScanOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanOutput::ScanOutput { + Items: ::std::rc::Rc::new(match &value.items { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&e.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Count: crate::standard_library_conversions::oint_to_dafny(Some(value.count)), + ScannedCount: crate::standard_library_conversions::oint_to_dafny(Some(value.scanned_count)), + LastEvaluatedKey: +::std::rc::Rc::new(match &value.last_evaluated_key { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/select.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/select.rs new file mode 100644 index 0000000000..52afedb1c3 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/select.rs @@ -0,0 +1,27 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::Select, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::Select::AllAttributes => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::ALL_ATTRIBUTES {}, + aws_sdk_dynamodb::types::Select::AllProjectedAttributes => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::ALL_PROJECTED_ATTRIBUTES {}, + aws_sdk_dynamodb::types::Select::SpecificAttributes => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::SPECIFIC_ATTRIBUTES {}, + aws_sdk_dynamodb::types::Select::Count => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::COUNT {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select, +) -> aws_sdk_dynamodb::types::Select { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::ALL_ATTRIBUTES {} => aws_sdk_dynamodb::types::Select::AllAttributes, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::ALL_PROJECTED_ATTRIBUTES {} => aws_sdk_dynamodb::types::Select::AllProjectedAttributes, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::SPECIFIC_ATTRIBUTES {} => aws_sdk_dynamodb::types::Select::SpecificAttributes, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Select::COUNT {} => aws_sdk_dynamodb::types::Select::Count, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_description.rs new file mode 100644 index 0000000000..898d38886f --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_description.rs @@ -0,0 +1,51 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::SseDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription::SSEDescription { + Status: ::std::rc::Rc::new(match &value.status { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::sse_status::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + SSEType: ::std::rc::Rc::new(match &value.sse_type { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::sse_type::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + KMSMasterKeyArn: crate::standard_library_conversions::ostring_to_dafny(&value.kms_master_key_arn), + InaccessibleEncryptionDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.inaccessible_encryption_date_time), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription, + >, +) -> aws_sdk_dynamodb::types::SseDescription { + aws_sdk_dynamodb::types::SseDescription::builder() + .set_status(match &**dafny_value.Status() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::sse_status::from_dafny(value) + ), + _ => None, +} +) + .set_sse_type(match &**dafny_value.SSEType() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::sse_type::from_dafny(value) + ), + _ => None, +} +) + .set_kms_master_key_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.KMSMasterKeyArn().clone())) + .set_inaccessible_encryption_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.InaccessibleEncryptionDateTime().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_specification.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_specification.rs new file mode 100644 index 0000000000..ef4ac19e67 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_specification.rs @@ -0,0 +1,39 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::SseSpecification, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification::SSESpecification { + Enabled: crate::standard_library_conversions::obool_to_dafny(&value.enabled), + SSEType: ::std::rc::Rc::new(match &value.sse_type { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::sse_type::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + KMSMasterKeyId: crate::standard_library_conversions::ostring_to_dafny(&value.kms_master_key_id), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification, + >, +) -> aws_sdk_dynamodb::types::SseSpecification { + aws_sdk_dynamodb::types::SseSpecification::builder() + .set_enabled(crate::standard_library_conversions::obool_from_dafny(dafny_value.Enabled().clone())) + .set_sse_type(match &**dafny_value.SSEType() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::sse_type::from_dafny(value) + ), + _ => None, +} +) + .set_kms_master_key_id(crate::standard_library_conversions::ostring_from_dafny(dafny_value.KMSMasterKeyId().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_status.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_status.rs new file mode 100644 index 0000000000..fd0a2e7a4b --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_status.rs @@ -0,0 +1,29 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::SseStatus, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::SseStatus::Enabling => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::ENABLING {}, + aws_sdk_dynamodb::types::SseStatus::Enabled => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::ENABLED {}, + aws_sdk_dynamodb::types::SseStatus::Disabling => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::DISABLING {}, + aws_sdk_dynamodb::types::SseStatus::Disabled => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::DISABLED {}, + aws_sdk_dynamodb::types::SseStatus::Updating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::UPDATING {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus, +) -> aws_sdk_dynamodb::types::SseStatus { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::ENABLING {} => aws_sdk_dynamodb::types::SseStatus::Enabling, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::ENABLED {} => aws_sdk_dynamodb::types::SseStatus::Enabled, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::DISABLING {} => aws_sdk_dynamodb::types::SseStatus::Disabling, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::DISABLED {} => aws_sdk_dynamodb::types::SseStatus::Disabled, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus::UPDATING {} => aws_sdk_dynamodb::types::SseStatus::Updating, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_type.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_type.rs new file mode 100644 index 0000000000..6a6dfd122e --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/sse_type.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::SseType, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::SseType::Aes256 => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType::AES256 {}, + aws_sdk_dynamodb::types::SseType::Kms => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType::KMS {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType, +) -> aws_sdk_dynamodb::types::SseType { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType::AES256 {} => aws_sdk_dynamodb::types::SseType::Aes256, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType::KMS {} => aws_sdk_dynamodb::types::SseType::Kms, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_specification.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_specification.rs new file mode 100644 index 0000000000..564564f214 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_specification.rs @@ -0,0 +1,37 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::StreamSpecification, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification::StreamSpecification { + StreamEnabled: value.stream_enabled, + StreamViewType: ::std::rc::Rc::new(match &value.stream_view_type { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::stream_view_type::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification, + >, +) -> aws_sdk_dynamodb::types::StreamSpecification { + aws_sdk_dynamodb::types::StreamSpecification::builder() + .set_stream_enabled(Some( dafny_value.StreamEnabled() .clone())) + .set_stream_view_type(match &**dafny_value.StreamViewType() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::stream_view_type::from_dafny(value) + ), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_view_type.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_view_type.rs new file mode 100644 index 0000000000..df3a0c2b7b --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/stream_view_type.rs @@ -0,0 +1,27 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::StreamViewType, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::StreamViewType::NewImage => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::NEW_IMAGE {}, + aws_sdk_dynamodb::types::StreamViewType::OldImage => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::OLD_IMAGE {}, + aws_sdk_dynamodb::types::StreamViewType::NewAndOldImages => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::NEW_AND_OLD_IMAGES {}, + aws_sdk_dynamodb::types::StreamViewType::KeysOnly => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::KEYS_ONLY {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType, +) -> aws_sdk_dynamodb::types::StreamViewType { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::NEW_IMAGE {} => aws_sdk_dynamodb::types::StreamViewType::NewImage, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::OLD_IMAGE {} => aws_sdk_dynamodb::types::StreamViewType::OldImage, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::NEW_AND_OLD_IMAGES {} => aws_sdk_dynamodb::types::StreamViewType::NewAndOldImages, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType::KEYS_ONLY {} => aws_sdk_dynamodb::types::StreamViewType::KeysOnly, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class.rs new file mode 100644 index 0000000000..dba3a71daa --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class.rs @@ -0,0 +1,23 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::TableClass, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::TableClass::Standard => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass::STANDARD {}, + aws_sdk_dynamodb::types::TableClass::StandardInfrequentAccess => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass::STANDARD_INFREQUENT_ACCESS {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass, +) -> aws_sdk_dynamodb::types::TableClass { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass::STANDARD {} => aws_sdk_dynamodb::types::TableClass::Standard, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass::STANDARD_INFREQUENT_ACCESS {} => aws_sdk_dynamodb::types::TableClass::StandardInfrequentAccess, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class_summary.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class_summary.rs new file mode 100644 index 0000000000..7c3eaf0a1d --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_class_summary.rs @@ -0,0 +1,37 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::TableClassSummary, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary::TableClassSummary { + TableClass: ::std::rc::Rc::new(match &value.table_class { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_class::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + LastUpdateDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.last_update_date_time), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary, + >, +) -> aws_sdk_dynamodb::types::TableClassSummary { + aws_sdk_dynamodb::types::TableClassSummary::builder() + .set_table_class(match &**dafny_value.TableClass() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::table_class::from_dafny(value) + ), + _ => None, +} +) + .set_last_update_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.LastUpdateDateTime().clone())) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_description.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_description.rs new file mode 100644 index 0000000000..94615fed33 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_description.rs @@ -0,0 +1,235 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::TableDescription, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription::TableDescription { + AttributeDefinitions: ::std::rc::Rc::new(match &value.attribute_definitions { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::attribute_definition::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name), + KeySchema: ::std::rc::Rc::new(match &value.key_schema { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::key_schema_element::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + TableStatus: ::std::rc::Rc::new(match &value.table_status { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_status::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + CreationDateTime: crate::standard_library_conversions::otimestamp_to_dafny(&value.creation_date_time), + ProvisionedThroughput: ::std::rc::Rc::new(match &value.provisioned_throughput { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::provisioned_throughput_description::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + TableSizeBytes: crate::standard_library_conversions::olong_to_dafny(&value.table_size_bytes), + ItemCount: crate::standard_library_conversions::olong_to_dafny(&value.item_count), + TableArn: crate::standard_library_conversions::ostring_to_dafny(&value.table_arn), + TableId: crate::standard_library_conversions::ostring_to_dafny(&value.table_id), + BillingModeSummary: ::std::rc::Rc::new(match &value.billing_mode_summary { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::billing_mode_summary::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + LocalSecondaryIndexes: ::std::rc::Rc::new(match &value.local_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::local_secondary_index_description::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + GlobalSecondaryIndexes: ::std::rc::Rc::new(match &value.global_secondary_indexes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::global_secondary_index_description::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + StreamSpecification: ::std::rc::Rc::new(match &value.stream_specification { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::stream_specification::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + LatestStreamLabel: crate::standard_library_conversions::ostring_to_dafny(&value.latest_stream_label), + LatestStreamArn: crate::standard_library_conversions::ostring_to_dafny(&value.latest_stream_arn), + GlobalTableVersion: crate::standard_library_conversions::ostring_to_dafny(&value.global_table_version), + Replicas: ::std::rc::Rc::new(match &value.replicas { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::replica_description::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + RestoreSummary: ::std::rc::Rc::new(match &value.restore_summary { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::restore_summary::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + SSEDescription: ::std::rc::Rc::new(match &value.sse_description { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::sse_description::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ArchivalSummary: ::std::rc::Rc::new(match &value.archival_summary { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::archival_summary::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + TableClassSummary: ::std::rc::Rc::new(match &value.table_class_summary { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::table_class_summary::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription, + >, +) -> aws_sdk_dynamodb::types::TableDescription { + aws_sdk_dynamodb::types::TableDescription::builder() + .set_attribute_definitions(match (*dafny_value.AttributeDefinitions()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::attribute_definition::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_table_name(crate::standard_library_conversions::ostring_from_dafny(dafny_value.TableName().clone())) + .set_key_schema(match (*dafny_value.KeySchema()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::key_schema_element::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_table_status(match &**dafny_value.TableStatus() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::table_status::from_dafny(value) + ), + _ => None, +} +) + .set_creation_date_time(crate::standard_library_conversions::otimestamp_from_dafny(dafny_value.CreationDateTime().clone())) + .set_provisioned_throughput(match (*dafny_value.ProvisionedThroughput()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::provisioned_throughput_description::from_dafny(value.clone())), + _ => None, +} +) + .set_table_size_bytes(crate::standard_library_conversions::olong_from_dafny(dafny_value.TableSizeBytes().clone())) + .set_item_count(crate::standard_library_conversions::olong_from_dafny(dafny_value.ItemCount().clone())) + .set_table_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.TableArn().clone())) + .set_table_id(crate::standard_library_conversions::ostring_from_dafny(dafny_value.TableId().clone())) + .set_billing_mode_summary(match (*dafny_value.BillingModeSummary()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::billing_mode_summary::from_dafny(value.clone())), + _ => None, +} +) + .set_local_secondary_indexes(match (*dafny_value.LocalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::local_secondary_index_description::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_global_secondary_indexes(match (*dafny_value.GlobalSecondaryIndexes()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::global_secondary_index_description::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_stream_specification(match (*dafny_value.StreamSpecification()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::stream_specification::from_dafny(value.clone())), + _ => None, +} +) + .set_latest_stream_label(crate::standard_library_conversions::ostring_from_dafny(dafny_value.LatestStreamLabel().clone())) + .set_latest_stream_arn(crate::standard_library_conversions::ostring_from_dafny(dafny_value.LatestStreamArn().clone())) + .set_global_table_version(crate::standard_library_conversions::ostring_from_dafny(dafny_value.GlobalTableVersion().clone())) + .set_replicas(match (*dafny_value.Replicas()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, + |e| crate::conversions::replica_description::from_dafny(e.clone()) +, + ) + ), + _ => None +} +) + .set_restore_summary(match (*dafny_value.RestoreSummary()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::restore_summary::from_dafny(value.clone())), + _ => None, +} +) + .set_sse_description(match (*dafny_value.SSEDescription()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::sse_description::from_dafny(value.clone())), + _ => None, +} +) + .set_archival_summary(match (*dafny_value.ArchivalSummary()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::archival_summary::from_dafny(value.clone())), + _ => None, +} +) + .set_table_class_summary(match (*dafny_value.TableClassSummary()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::table_class_summary::from_dafny(value.clone())), + _ => None, +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_status.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_status.rs new file mode 100644 index 0000000000..444e0c5411 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/table_status.rs @@ -0,0 +1,33 @@ +// 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. +#[allow(dead_code)] + +pub fn to_dafny( + value: aws_sdk_dynamodb::types::TableStatus, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new(match value { + aws_sdk_dynamodb::types::TableStatus::Creating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::CREATING {}, + aws_sdk_dynamodb::types::TableStatus::Updating => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::UPDATING {}, + aws_sdk_dynamodb::types::TableStatus::Deleting => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::DELETING {}, + aws_sdk_dynamodb::types::TableStatus::Active => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ACTIVE {}, + aws_sdk_dynamodb::types::TableStatus::InaccessibleEncryptionCredentials => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {}, + aws_sdk_dynamodb::types::TableStatus::Archiving => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ARCHIVING {}, + aws_sdk_dynamodb::types::TableStatus::Archived => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ARCHIVED {}, + _ => panic!("Unknown enum variant: {}", value), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus, +) -> aws_sdk_dynamodb::types::TableStatus { + match dafny_value { + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::CREATING {} => aws_sdk_dynamodb::types::TableStatus::Creating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::UPDATING {} => aws_sdk_dynamodb::types::TableStatus::Updating, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::DELETING {} => aws_sdk_dynamodb::types::TableStatus::Deleting, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ACTIVE {} => aws_sdk_dynamodb::types::TableStatus::Active, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {} => aws_sdk_dynamodb::types::TableStatus::InaccessibleEncryptionCredentials, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ARCHIVING {} => aws_sdk_dynamodb::types::TableStatus::Archiving, + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus::ARCHIVED {} => aws_sdk_dynamodb::types::TableStatus::Archived, + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/tag.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/tag.rs new file mode 100644 index 0000000000..40826cab46 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/tag.rs @@ -0,0 +1,27 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Tag, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag::Tag { + Key: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.key), + Value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.value), + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag, + >, +) -> aws_sdk_dynamodb::types::Tag { + aws_sdk_dynamodb::types::Tag::builder() + .set_key(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.Key()) )) + .set_value(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.Value()) )) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_item.rs new file mode 100644 index 0000000000..8f660ec508 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_item.rs @@ -0,0 +1,67 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::TransactWriteItem, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem::TransactWriteItem { + ConditionCheck: ::std::rc::Rc::new(match &value.condition_check { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::condition_check::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Put: ::std::rc::Rc::new(match &value.put { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::put::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Delete: ::std::rc::Rc::new(match &value.delete { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::delete::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + Update: ::std::rc::Rc::new(match &value.update { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::update::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem, + >, +) -> aws_sdk_dynamodb::types::TransactWriteItem { + aws_sdk_dynamodb::types::TransactWriteItem::builder() + .set_condition_check(match (*dafny_value.ConditionCheck()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::condition_check::from_dafny(value.clone())), + _ => None, +} +) + .set_put(match (*dafny_value.Put()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::put::from_dafny(value.clone())), + _ => None, +} +) + .set_delete(match (*dafny_value.Delete()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::delete::from_dafny(value.clone())), + _ => None, +} +) + .set_update(match (*dafny_value.Update()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some(crate::conversions::update::from_dafny(value.clone())), + _ => None, +} +) + .build() + +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items.rs new file mode 100644 index 0000000000..cbc0f6efdb --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items.rs @@ -0,0 +1,38 @@ +// 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. +pub mod _transact_write_items_request; + + pub mod _transact_write_items_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::IdempotentParameterMismatchException(e) => + crate::conversions::error::idempotent_parameter_mismatch_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::TransactionCanceledException(e) => + crate::conversions::error::transaction_canceled_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsError::TransactionInProgressException(e) => + crate::conversions::error::transaction_in_progress_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_request.rs new file mode 100644 index 0000000000..3b13d631e8 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_request.rs @@ -0,0 +1,57 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsInput::TransactWriteItemsInput { + TransactItems: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.transact_items.clone().unwrap(), + |e| crate::conversions::transact_write_item::to_dafny(&e) +, +) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnItemCollectionMetrics: ::std::rc::Rc::new(match &value.return_item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_item_collection_metrics::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ClientRequestToken: crate::standard_library_conversions::ostring_to_dafny(&value.client_request_token), + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::transact_write_items::builders::TransactWriteItemsFluentBuilder { + client.transact_write_items() + .set_transact_items(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.TransactItems(), + |e| crate::conversions::transact_write_item::from_dafny(e.clone()) +, +) + )) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_return_item_collection_metrics(match &**dafny_value.ReturnItemCollectionMetrics() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_item_collection_metrics::from_dafny(value) + ), + _ => None, +} +) + .set_client_request_token(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ClientRequestToken().clone())) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_response.rs new file mode 100644 index 0000000000..290e92bc79 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/transact_write_items/_transact_write_items_response.rs @@ -0,0 +1,37 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::transact_write_items::TransactWriteItemsOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsOutput::TransactWriteItemsOutput { + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, + |e| crate::conversions::consumed_capacity::to_dafny(&e) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ItemCollectionMetrics: +::std::rc::Rc::new(match &value.item_collection_metrics { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&v, + |e| crate::conversions::item_collection_metrics::to_dafny(&e) +, +) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update.rs new file mode 100644 index 0000000000..e3bc3971e8 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update.rs @@ -0,0 +1,99 @@ +// 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. +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::types::Update, +) -> ::std::rc::Rc{ + ::std::rc::Rc::new( + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Update::Update { + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + UpdateExpression: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.update_expression), + TableName: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&value.table_name), + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + } + ) +} #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Update, + >, +) -> aws_sdk_dynamodb::types::Update { + aws_sdk_dynamodb::types::Update::builder() + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_update_expression(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.UpdateExpression()) )) + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) + .build() + .unwrap() +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item.rs new file mode 100644 index 0000000000..7258df4a34 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item.rs @@ -0,0 +1,38 @@ +// 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. +pub mod _update_item_request; + + pub mod _update_item_response; + #[allow(dead_code)] +pub fn to_dafny_error( + value: &::aws_smithy_runtime_api::client::result::SdkError< + aws_sdk_dynamodb::operation::update_item::UpdateItemError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, +) -> ::std::rc::Rc { + match value { + aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { + aws_sdk_dynamodb::operation::update_item::UpdateItemError::InternalServerError(e) => + crate::conversions::error::internal_server_error::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::InvalidEndpointException(e) => + crate::conversions::error::invalid_endpoint_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::ResourceNotFoundException(e) => + crate::conversions::error::resource_not_found_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::RequestLimitExceeded(e) => + crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::TransactionConflictException(e) => + crate::conversions::error::transaction_conflict_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::ConditionalCheckFailedException(e) => + crate::conversions::error::conditional_check_failed_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::ItemCollectionSizeLimitExceededException(e) => + crate::conversions::error::item_collection_size_limit_exceeded_exception::to_dafny(e.clone()), + aws_sdk_dynamodb::operation::update_item::UpdateItemError::ProvisionedThroughputExceededException(e) => + crate::conversions::error::provisioned_throughput_exceeded_exception::to_dafny(e.clone()), + e => crate::conversions::error::to_opaque_error(e.to_string()), + }, + _ => { + crate::conversions::error::to_opaque_error(value.to_string()) + } + } +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_request.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_request.rs new file mode 100644 index 0000000000..9adc67ba20 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_request.rs @@ -0,0 +1,181 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::update_item::UpdateItemInput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemInput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemInput::UpdateItemInput { + TableName: crate::standard_library_conversions::ostring_to_dafny(&value.table_name) .Extract(), + Key: ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&value.key.clone().unwrap(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, +) +, + AttributeUpdates: +::std::rc::Rc::new(match &value.attribute_updates { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value_update::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + Expected: +::std::rc::Rc::new(match &value.expected { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::expected_attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConditionalOperator: ::std::rc::Rc::new(match &value.conditional_operator { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::conditional_operator::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnValues: ::std::rc::Rc::new(match &value.return_values { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_value::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ReturnItemCollectionMetrics: ::std::rc::Rc::new(match &value.return_item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_item_collection_metrics::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + UpdateExpression: crate::standard_library_conversions::ostring_to_dafny(&value.update_expression), + ConditionExpression: crate::standard_library_conversions::ostring_to_dafny(&value.condition_expression), + ExpressionAttributeNames: +::std::rc::Rc::new(match &value.expression_attribute_names { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ExpressionAttributeValues: +::std::rc::Rc::new(match &value.expression_attribute_values { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + }) +} + #[allow(dead_code)] +pub fn from_dafny( + dafny_value: ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemInput, + >, + client: aws_sdk_dynamodb::Client, +) -> aws_sdk_dynamodb::operation::update_item::builders::UpdateItemFluentBuilder { + client.update_item() + .set_table_name(Some( dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(dafny_value.TableName()) )) + .set_key(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&dafny_value.Key(), + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, +) + )) + .set_attribute_updates(match (*dafny_value.AttributeUpdates()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value_update::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_expected(match (*dafny_value.Expected()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::expected_attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) + .set_conditional_operator(match &**dafny_value.ConditionalOperator() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::conditional_operator::from_dafny(value) + ), + _ => None, +} +) + .set_return_values(match &**dafny_value.ReturnValues() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_value::from_dafny(value) + ), + _ => None, +} +) + .set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_consumed_capacity::from_dafny(value) + ), + _ => None, +} +) + .set_return_item_collection_metrics(match &**dafny_value.ReturnItemCollectionMetrics() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::conversions::return_item_collection_metrics::from_dafny(value) + ), + _ => None, +} +) + .set_update_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.UpdateExpression().clone())) + .set_condition_expression(crate::standard_library_conversions::ostring_from_dafny(dafny_value.ConditionExpression().clone())) + .set_expression_attribute_names(match (*dafny_value.ExpressionAttributeNames()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), + ) + ), + _ => None +} +) + .set_expression_attribute_values(match (*dafny_value.ExpressionAttributeValues()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v| crate::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_response.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_response.rs new file mode 100644 index 0000000000..4b998a9518 --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/update_item/_update_item_response.rs @@ -0,0 +1,34 @@ +// 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. +#[allow(dead_code)] +pub fn to_dafny( + value: &aws_sdk_dynamodb::operation::update_item::UpdateItemOutput +) -> ::std::rc::Rc< + crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemOutput, +>{ + ::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemOutput::UpdateItemOutput { + Attributes: +::std::rc::Rc::new(match &value.attributes { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::conversions::attribute_value::to_dafny(&v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, + ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::consumed_capacity::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + ItemCollectionMetrics: ::std::rc::Rc::new(match &value.item_collection_metrics { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::item_collection_metrics::to_dafny(&x) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, + }) +} diff --git a/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/implementation_from_dafny.rs b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/implementation_from_dafny.rs new file mode 100644 index 0000000000..1c10fb5dcf --- /dev/null +++ b/TestModels/aws-sdks/ddb-lite/runtimes/rust/src/implementation_from_dafny.rs @@ -0,0 +1,14565 @@ +#![allow(warnings, unconditional_panic)] +#![allow(nonstandard_style)] + +mod client; +mod conversions; +mod standard_library_conversions; + +pub mod r#_Wrappers_Compile { + pub use dafny_runtime::DafnyPrint; + pub use std::cmp::Eq; + pub use std::convert::AsRef; + pub use std::default::Default; + pub use std::fmt::Debug; + pub use std::hash::Hash; + + pub struct _default {} + + impl _default { + pub fn Need<_E: ::dafny_runtime::DafnyType>( + condition: bool, + error: &_E, + ) -> ::std::rc::Rc> { + if condition { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Outcome::<_E>::Pass {}) + } else { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Outcome::<_E>::Fail { + error: error.clone(), + }) + } + } + } + + #[derive(PartialEq, Clone)] + pub enum Option { + None {}, + Some { value: T }, + } + + impl Option { + pub fn ToResult( + self: &::std::rc::Rc, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + T, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + let mut _source0: ::std::rc::Rc> = self.clone(); + if matches!( + (&_source0).as_ref(), + crate::r#_Wrappers_Compile::Option::None { .. } + ) { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + T, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Failure { + error: ::dafny_runtime::string_utf16_of("Option is None"), + }) + } else { + let mut r#___mcc_h0: T = _source0.value().clone(); + let mut v: T = r#___mcc_h0.clone(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + T, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Success { + value: v.clone(), + }) + } + } + pub fn UnwrapOr(self: &::std::rc::Rc, default: &T) -> T { + let mut _source1: ::std::rc::Rc> = self.clone(); + if matches!( + (&_source1).as_ref(), + crate::r#_Wrappers_Compile::Option::None { .. } + ) { + default.clone() + } else { + let mut r#___mcc_h0: T = _source1.value().clone(); + let mut v: T = r#___mcc_h0.clone(); + v.clone() + } + } + pub fn IsFailure(self: &::std::rc::Rc) -> bool { + matches!( + self.as_ref(), + crate::r#_Wrappers_Compile::Option::None { .. } + ) + } + pub fn PropagateFailure<_U: ::dafny_runtime::DafnyType>( + self: &::std::rc::Rc, + ) -> ::std::rc::Rc> { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::<_U>::None {}) + } + pub fn Extract(self: &::std::rc::Rc) -> T { + self.value().clone() + } + pub fn value(&self) -> &T { + match self { + Option::None {} => panic!("field does not exist on this variant"), + Option::Some { value } => value, + } + } + } + + impl Debug for Option { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Option { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Option::None {} => { + write!(_formatter, "Wrappers_Compile.Option.None")?; + Ok(()) + } + Option::Some { value } => { + write!(_formatter, "Wrappers_Compile.Option.Some(")?; + ::dafny_runtime::DafnyPrint::fmt_print(value, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Option { + pub fn coerce( + f_0: ::std::rc::Rc r#__T0 + 'static>, + ) -> ::std::rc::Rc) -> Option> { + ::std::rc::Rc::new(move |this: Self| -> Option { + match this { + Option::None {} => Option::None {}, + Option::Some { value } => Option::Some { + value: f_0.clone()(value), + }, + } + }) + } + } + + impl Eq for Option {} + + impl Hash for Option { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Option::None {} => {} + Option::Some { value } => ::std::hash::Hash::hash(value, _state), + } + } + } + + impl Default for Option { + fn default() -> Option { + Option::None {} + } + } + + impl AsRef> for &Option { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum Result { + Success { value: T }, + Failure { error: R }, + } + + impl Result { + pub fn ToOption( + self: &::std::rc::Rc, + ) -> ::std::rc::Rc> { + let mut _source2: ::std::rc::Rc> = + self.clone(); + if matches!( + (&_source2).as_ref(), + crate::r#_Wrappers_Compile::Result::Success { .. } + ) { + let mut r#___mcc_h0: T = _source2.value().clone(); + let mut s: T = r#___mcc_h0.clone(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::::Some { + value: s.clone(), + }) + } else { + let mut r#___mcc_h1: R = _source2.error().clone(); + let mut e: R = r#___mcc_h1.clone(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::::None {}) + } + } + pub fn UnwrapOr(self: &::std::rc::Rc, default: &T) -> T { + let mut _source3: ::std::rc::Rc> = + self.clone(); + if matches!( + (&_source3).as_ref(), + crate::r#_Wrappers_Compile::Result::Success { .. } + ) { + let mut r#___mcc_h0: T = _source3.value().clone(); + let mut s: T = r#___mcc_h0.clone(); + s.clone() + } else { + let mut r#___mcc_h1: R = _source3.error().clone(); + let mut e: R = r#___mcc_h1.clone(); + default.clone() + } + } + pub fn IsFailure(self: &::std::rc::Rc) -> bool { + matches!( + self.as_ref(), + crate::r#_Wrappers_Compile::Result::Failure { .. } + ) + } + pub fn PropagateFailure<_U: ::dafny_runtime::DafnyType>( + self: &::std::rc::Rc, + ) -> ::std::rc::Rc> { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::<_U, R>::Failure { + error: self.error().clone(), + }) + } + pub fn MapFailure<_NewR: ::dafny_runtime::DafnyType>( + self: &::std::rc::Rc, + reWrap: &::std::rc::Rc _NewR>, + ) -> ::std::rc::Rc> { + let mut _source4: ::std::rc::Rc> = + self.clone(); + if matches!( + (&_source4).as_ref(), + crate::r#_Wrappers_Compile::Result::Success { .. } + ) { + let mut r#___mcc_h0: T = _source4.value().clone(); + let mut s: T = r#___mcc_h0.clone(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::::Success { + value: s.clone(), + }) + } else { + let mut r#___mcc_h1: R = _source4.error().clone(); + let mut e: R = r#___mcc_h1.clone(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::::Failure { + error: reWrap(&e), + }) + } + } + pub fn Extract(self: &::std::rc::Rc) -> T { + self.value().clone() + } + pub fn value(&self) -> &T { + match self { + Result::Success { value } => value, + Result::Failure { error } => panic!("field does not exist on this variant"), + } + } + pub fn error(&self) -> &R { + match self { + Result::Success { value } => panic!("field does not exist on this variant"), + Result::Failure { error } => error, + } + } + } + + impl Debug for Result { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Result { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Result::Success { value } => { + write!(_formatter, "Wrappers_Compile.Result.Success(")?; + ::dafny_runtime::DafnyPrint::fmt_print(value, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + } + Result::Failure { error } => { + write!(_formatter, "Wrappers_Compile.Result.Failure(")?; + ::dafny_runtime::DafnyPrint::fmt_print(error, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Result { + pub fn coerce( + f_0: ::std::rc::Rc r#__T0 + 'static>, + f_1: ::std::rc::Rc r#__T1 + 'static>, + ) -> ::std::rc::Rc) -> Result> { + ::std::rc::Rc::new(move |this: Self| -> Result { + match this { + Result::Success { value } => Result::Success { + value: f_0.clone()(value), + }, + Result::Failure { error } => Result::Failure { + error: f_1.clone()(error), + }, + } + }) + } + } + + impl Eq for Result {} + + impl Hash + for Result + { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Result::Success { value } => ::std::hash::Hash::hash(value, _state), + Result::Failure { error } => ::std::hash::Hash::hash(error, _state), + } + } + } + + impl Default + for Result + { + fn default() -> Result { + Result::Success { + value: ::std::default::Default::default(), + } + } + } + + impl AsRef> + for &Result + { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum Outcome { + Pass {}, + Fail { error: E }, + } + + impl Outcome { + pub fn IsFailure(self: &::std::rc::Rc) -> bool { + matches!( + self.as_ref(), + crate::r#_Wrappers_Compile::Outcome::Fail { .. } + ) + } + pub fn PropagateFailure<_U: ::dafny_runtime::DafnyType>( + self: &::std::rc::Rc, + ) -> ::std::rc::Rc> { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::<_U, E>::Failure { + error: self.error().clone(), + }) + } + pub fn error(&self) -> &E { + match self { + Outcome::Pass {} => panic!("field does not exist on this variant"), + Outcome::Fail { error } => error, + } + } + } + + impl Debug for Outcome { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Outcome { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Outcome::Pass {} => { + write!(_formatter, "Wrappers_Compile.Outcome.Pass")?; + Ok(()) + } + Outcome::Fail { error } => { + write!(_formatter, "Wrappers_Compile.Outcome.Fail(")?; + ::dafny_runtime::DafnyPrint::fmt_print(error, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Outcome {} + + impl Hash for Outcome { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Outcome::Pass {} => {} + Outcome::Fail { error } => ::std::hash::Hash::hash(error, _state), + } + } + } + + impl Default for Outcome { + fn default() -> Outcome { + Outcome::Pass {} + } + } + + impl AsRef> for &Outcome { + fn as_ref(&self) -> Self { + self + } + } +} +pub mod r#_StandardLibrary_Compile { + pub struct _default {} + + impl _default { + pub fn Join<_T: ::dafny_runtime::DafnyType>( + ss: &::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>>, + joiner: &::dafny_runtime::Sequence<_T>, + ) -> ::dafny_runtime::Sequence<_T> { + let mut _accumulator: ::dafny_runtime::Sequence<_T> = + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence<_T>; + let mut ss = ss.clone(); + let mut joiner = joiner.clone(); + let mut _accumulator = _accumulator.clone(); + 'TAIL_CALL_START: loop { + if ss.cardinality() == ::dafny_runtime::int!(1) { + return _accumulator.concat(&ss.get(&::dafny_runtime::int!(0))); + } else { + _accumulator = + _accumulator.concat(&ss.get(&::dafny_runtime::int!(0)).concat(&joiner)); + let mut _in0: ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>> = + ss.drop(&::dafny_runtime::int!(1)); + let mut _in1: ::dafny_runtime::Sequence<_T> = joiner.clone(); + ss = _in0.clone(); + joiner = _in1.clone(); + continue 'TAIL_CALL_START; + } + } + } + pub fn Split<_T: ::dafny_runtime::DafnyTypeEq>( + s: &::dafny_runtime::Sequence<_T>, + delim: &_T, + ) -> ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>> { + let mut _accumulator: ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>> = + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>>; + let mut s = s.clone(); + let mut delim = delim.clone(); + let mut _accumulator = _accumulator.clone(); + 'TAIL_CALL_START: loop { + let mut i: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option<::dafny_runtime::_System::nat>, + > = crate::r#_StandardLibrary_Compile::_default::FindIndexMatching::<_T>( + &s, + &delim, + &::dafny_runtime::int!(0), + ); + if matches!( + (&i).as_ref(), + crate::r#_Wrappers_Compile::Option::Some { .. } + ) { + _accumulator = _accumulator.concat(&::dafny_runtime::seq![s.take(i.value())]); + let mut _in2: ::dafny_runtime::Sequence<_T> = + s.drop(&(i.value().clone() + ::dafny_runtime::int!(1))); + let mut _in3: _T = delim.clone(); + s = _in2.clone(); + delim = _in3.clone(); + continue 'TAIL_CALL_START; + } else { + return _accumulator.concat(&::dafny_runtime::seq![s.clone()]); + } + } + } + pub fn SplitOnce<_T: ::dafny_runtime::DafnyTypeEq>( + s: &::dafny_runtime::Sequence<_T>, + delim: &_T, + ) -> (::dafny_runtime::Sequence<_T>, ::dafny_runtime::Sequence<_T>) { + let mut i: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option<::dafny_runtime::_System::nat>, + > = crate::r#_StandardLibrary_Compile::_default::FindIndexMatching::<_T>( + s, + delim, + &::dafny_runtime::int!(0), + ); + ( + s.take(i.value()), + s.drop(&(i.value().clone() + ::dafny_runtime::int!(1))), + ) + } + pub fn r#_SplitOnce_q<_T: ::dafny_runtime::DafnyTypeEq>( + s: &::dafny_runtime::Sequence<_T>, + delim: &_T, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option<( + ::dafny_runtime::Sequence<_T>, + ::dafny_runtime::Sequence<_T>, + )>, + > { + let mut valueOrError0: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option<::dafny_runtime::_System::nat>, + > = crate::r#_StandardLibrary_Compile::_default::FindIndexMatching::<_T>( + s, + delim, + &::dafny_runtime::int!(0), + ); + if valueOrError0.IsFailure() { + valueOrError0.PropagateFailure::<(::dafny_runtime::Sequence<_T>, ::dafny_runtime::Sequence<_T>)>() + } else { + let mut i: ::dafny_runtime::_System::nat = valueOrError0.Extract(); + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::<( + ::dafny_runtime::Sequence<_T>, + ::dafny_runtime::Sequence<_T>, + )>::Some { + value: (s.take(&i), s.drop(&(i.clone() + ::dafny_runtime::int!(1)))), + }) + } + } + pub fn FindIndexMatching<_T: ::dafny_runtime::DafnyTypeEq>( + s: &::dafny_runtime::Sequence<_T>, + c: &_T, + i: &::dafny_runtime::_System::nat, + ) -> ::std::rc::Rc> + { + crate::r#_StandardLibrary_Compile::_default::FindIndex::<_T>( + s, + { + let c: _T = c.clone(); + &({ + let mut c = c.clone(); + ::std::rc::Rc::new(move |x: &_T| -> bool { x.clone() == c.clone() }) + }) + }, + i, + ) + } + pub fn FindIndex<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + f: &::std::rc::Rc bool>, + i: &::dafny_runtime::_System::nat, + ) -> ::std::rc::Rc> + { + let mut s = s.clone(); + let mut f = f.clone(); + let mut i = i.clone(); + 'TAIL_CALL_START: loop { + if i.clone() == s.cardinality() { + return ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::< + ::dafny_runtime::_System::nat, + >::None {}); + } else { + if (&f)(&s.get(&i)) { + return ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Option::< + ::dafny_runtime::_System::nat, + >::Some { + value: i.clone(), + }); + } else { + let mut _in4: ::dafny_runtime::Sequence<_T> = s.clone(); + let mut _in5: ::std::rc::Rc bool> = f.clone(); + let mut _in6: ::dafny_runtime::DafnyInt = + i.clone() + ::dafny_runtime::int!(1); + s = _in4.clone(); + f = _in5.clone(); + i = _in6.clone(); + continue 'TAIL_CALL_START; + } + } + } + } + pub fn Filter<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + f: &::std::rc::Rc bool>, + ) -> ::dafny_runtime::Sequence<_T> { + let mut _accumulator: ::dafny_runtime::Sequence<_T> = + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence<_T>; + let mut s = s.clone(); + let mut f = f.clone(); + let mut _accumulator = _accumulator.clone(); + 'TAIL_CALL_START: loop { + if s.cardinality() == ::dafny_runtime::int!(0) { + return _accumulator + .concat(&(::dafny_runtime::seq![] as ::dafny_runtime::Sequence<_T>)); + } else { + if (&f)(&s.get(&::dafny_runtime::int!(0))) { + _accumulator = _accumulator + .concat(&::dafny_runtime::seq![s.get(&::dafny_runtime::int!(0))]); + let mut _in7: ::dafny_runtime::Sequence<_T> = + s.drop(&::dafny_runtime::int!(1)); + let mut _in8: ::std::rc::Rc bool> = f.clone(); + s = _in7.clone(); + f = _in8.clone(); + continue 'TAIL_CALL_START; + } else { + let mut _in9: ::dafny_runtime::Sequence<_T> = + s.drop(&::dafny_runtime::int!(1)); + let mut _in10: ::std::rc::Rc bool> = f.clone(); + s = _in9.clone(); + f = _in10.clone(); + continue 'TAIL_CALL_START; + } + } + } + } + pub fn Min( + a: &::dafny_runtime::DafnyInt, + b: &::dafny_runtime::DafnyInt, + ) -> ::dafny_runtime::DafnyInt { + if a.clone() < b.clone() { + a.clone() + } else { + b.clone() + } + } + pub fn Fill<_T: ::dafny_runtime::DafnyType>( + value: &_T, + n: &::dafny_runtime::_System::nat, + ) -> ::dafny_runtime::Sequence<_T> { + { + let _initializer = { + let value: _T = value.clone(); + { + let mut value = value.clone(); + ::std::rc::Rc::new(move |_v0: &::dafny_runtime::DafnyInt| -> _T { + value.clone() + }) + } + }; + ::dafny_runtime::integer_range(::dafny_runtime::Zero::zero(), n.clone()) + .map(|i| _initializer(&i)) + .collect::<::dafny_runtime::Sequence<_>>() + } + } + pub fn SeqToArray<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + ) -> ::dafny_runtime::Object<[_T]> { + let mut a = ::dafny_runtime::MaybePlacebo::<::dafny_runtime::Object<[_T]>>::new(); + let mut _init0: ::std::rc::Rc _T> = { + let s: ::dafny_runtime::Sequence<_T> = s.clone(); + { + let mut s = s.clone(); + ::std::rc::Rc::new(move |i: &::dafny_runtime::DafnyInt| -> _T { s.get(i) }) + } + }; + let mut _nw0: ::dafny_runtime::Object<[::std::mem::MaybeUninit<_T>]> = + ::dafny_runtime::array::placebos_usize_object::<_T>( + ::dafny_runtime::DafnyUsize::into_usize(s.cardinality()), + ); + for r#__i0_0 in + ::dafny_runtime::integer_range(0, ::dafny_runtime::rd!(_nw0.clone()).len()) + { + { + let __idx0 = ::dafny_runtime::DafnyUsize::into_usize(r#__i0_0.clone()); + ::dafny_runtime::md!(_nw0)[__idx0] = ::std::mem::MaybeUninit::new((&_init0)( + &::dafny_runtime::int!(r#__i0_0.clone()), + )); + } + } + a = ::dafny_runtime::MaybePlacebo::from(::dafny_runtime::array::construct_object( + _nw0.clone(), + )); + return a.read(); + } + pub fn LexicographicLessOrEqual<_T: ::dafny_runtime::DafnyTypeEq>( + a: &::dafny_runtime::Sequence<_T>, + b: &::dafny_runtime::Sequence<_T>, + less: &::std::rc::Rc bool>, + ) -> bool { + ::dafny_runtime::integer_range(::dafny_runtime::int!(0), a.cardinality() + ::dafny_runtime::int!(1)).any(({ + let mut a = a.clone(); + let mut b = b.clone(); + let mut less = less.clone(); + ::std::rc::Rc::new(move |r#__exists_var_0: ::dafny_runtime::DafnyInt| -> bool{ + let mut k: ::dafny_runtime::DafnyInt = r#__exists_var_0.clone(); + ::dafny_runtime::int!(0) <= k.clone() && k.clone() <= a.cardinality() && crate::r#_StandardLibrary_Compile::_default::LexicographicLessOrEqualAux::<_T>(&a, &b, &less, &k) + }) + }).as_ref()) + } + pub fn LexicographicLessOrEqualAux<_T: ::dafny_runtime::DafnyTypeEq>( + a: &::dafny_runtime::Sequence<_T>, + b: &::dafny_runtime::Sequence<_T>, + less: &::std::rc::Rc bool>, + lengthOfCommonPrefix: &::dafny_runtime::_System::nat, + ) -> bool { + lengthOfCommonPrefix.clone() <= b.cardinality() + && ::dafny_runtime::integer_range( + ::dafny_runtime::int!(0), + lengthOfCommonPrefix.clone(), + ) + .all( + ({ + let mut lengthOfCommonPrefix = lengthOfCommonPrefix.clone(); + let mut a = a.clone(); + let mut b = b.clone(); + ::std::rc::Rc::new( + move |r#__forall_var_0: ::dafny_runtime::DafnyInt| -> bool { + let mut i: ::dafny_runtime::DafnyInt = r#__forall_var_0.clone(); + !(::dafny_runtime::int!(0) <= i.clone() + && i.clone() < lengthOfCommonPrefix.clone()) + || a.get(&i) == b.get(&i) + }, + ) + }) + .as_ref(), + ) + && (lengthOfCommonPrefix.clone() == a.cardinality() + || lengthOfCommonPrefix.clone() < b.cardinality() + && less(&a.get(lengthOfCommonPrefix), &b.get(lengthOfCommonPrefix))) + } + pub fn SetToOrderedSequence<_T: ::dafny_runtime::DafnyTypeEq>( + s: &::dafny_runtime::Set<::dafny_runtime::Sequence<_T>>, + less: &::std::rc::Rc bool>, + ) -> ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>> { + let mut _accumulator: ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>> = + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>>; + let mut s = s.clone(); + let mut less = less.clone(); + let mut _accumulator = _accumulator.clone(); + 'TAIL_CALL_START: loop { + if s.clone() == ::dafny_runtime::set! {} { + return _accumulator.concat( + &(::dafny_runtime::seq![] + as ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>>), + ); + } else { + return (&({ + let mut s = s.clone(); + let mut less = less.clone(); + ::std::rc::Rc::new(move |r#__let_dummy_0: &::dafny_runtime::DafnyInt| -> ::dafny_runtime::Sequence<::dafny_runtime::Sequence<_T>>{ + let mut a = ::dafny_runtime::MaybePlacebo::<::dafny_runtime::Sequence<_T>>::new(); + 'label_goto__ASSIGN_SUCH_THAT_0: loop { + for r#__assign_such_that_0 in (&s).iter().cloned() { + a = ::dafny_runtime::MaybePlacebo::from(r#__assign_such_that_0.clone()); + if s.contains(&a.read()) && crate::r#_StandardLibrary_Compile::_default::IsMinimum::<_T>(&a.read(), &s, &less) { + break 'label_goto__ASSIGN_SUCH_THAT_0; + } + } + panic!("Halt"); + break; + }; + ::dafny_runtime::seq![a.read()].concat(&crate::r#_StandardLibrary_Compile::_default::SetToOrderedSequence::<_T>(&s.subtract(&::dafny_runtime::set!{a.read()}), &less)) + }) + }))(&::dafny_runtime::int!(0)); + } + } + } + pub fn IsMinimum<_T: ::dafny_runtime::DafnyTypeEq>( + a: &::dafny_runtime::Sequence<_T>, + s: &::dafny_runtime::Set<::dafny_runtime::Sequence<_T>>, + less: &::std::rc::Rc bool>, + ) -> bool { + s.contains(a) && s.iter().all(({ + let mut a = a.clone(); + let mut s = s.clone(); + let mut less = less.clone(); + ::std::rc::Rc::new(move |r#__forall_var_1: &::dafny_runtime::Sequence<_T>| -> bool{ + let mut z: ::dafny_runtime::Sequence<_T> = r#__forall_var_1.clone(); + !s.contains(&z) || crate::r#_StandardLibrary_Compile::_default::LexicographicLessOrEqual::<_T>(&a, &z, &less) + }) + }).as_ref()) + } + } + + pub mod r#_UInt_Compile { + pub use dafny_runtime::DafnyPrint; + pub use std::default::Default; + + pub struct _default {} + + impl _default { + pub fn UInt8Less(a: u8, b: u8) -> bool { + a < b + } + pub fn HasUint16Len<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + ) -> bool { + s.cardinality() + < crate::r#_StandardLibrary_Compile::r#_UInt_Compile::_default::UINT16_LIMIT() + } + pub fn HasUint32Len<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + ) -> bool { + s.cardinality() + < crate::r#_StandardLibrary_Compile::r#_UInt_Compile::_default::UINT32_LIMIT() + } + pub fn HasUint64Len<_T: ::dafny_runtime::DafnyType>( + s: &::dafny_runtime::Sequence<_T>, + ) -> bool { + s.cardinality() + < crate::r#_StandardLibrary_Compile::r#_UInt_Compile::_default::UINT64_LIMIT() + } + pub fn UInt16ToSeq(x: u16) -> ::dafny_runtime::Sequence { + let mut b0: u8 = (x / 256) as u8; + let mut b1: u8 = (x % 256) as u8; + ::dafny_runtime::seq![b0, b1] + } + pub fn SeqToUInt16(s: &::dafny_runtime::Sequence) -> u16 { + let mut x0: u16 = s.get(&::dafny_runtime::int!(0)) as u16 * 256; + x0 + s.get(&::dafny_runtime::int!(1)) as u16 + } + pub fn UInt32ToSeq(x: u32) -> ::dafny_runtime::Sequence { + let mut b0: u8 = (x / 16777216) as u8; + let mut x0: u32 = x - b0 as u32 * 16777216; + let mut b1: u8 = (x0 / 65536) as u8; + let mut x1: u32 = x0 - b1 as u32 * 65536; + let mut b2: u8 = (x1 / 256) as u8; + let mut b3: u8 = (x1 % 256) as u8; + ::dafny_runtime::seq![b0, b1, b2, b3] + } + pub fn SeqToUInt32(s: &::dafny_runtime::Sequence) -> u32 { + let mut x0: u32 = s.get(&::dafny_runtime::int!(0)) as u32 * 16777216; + let mut x1: u32 = x0 + s.get(&::dafny_runtime::int!(1)) as u32 * 65536; + let mut x2: u32 = x1 + s.get(&::dafny_runtime::int!(2)) as u32 * 256; + x2 + s.get(&::dafny_runtime::int!(3)) as u32 + } + pub fn UInt64ToSeq(x: u64) -> ::dafny_runtime::Sequence { + let mut b0: u8 = (x / 72057594037927936) as u8; + let mut x0: u64 = x - b0 as u64 * 72057594037927936; + let mut b1: u8 = (x0 / 281474976710656) as u8; + let mut x1: u64 = x0 - b1 as u64 * 281474976710656; + let mut b2: u8 = (x1 / 1099511627776) as u8; + let mut x2: u64 = x1 - b2 as u64 * 1099511627776; + let mut b3: u8 = (x2 / 4294967296) as u8; + let mut x3: u64 = x2 - b3 as u64 * 4294967296; + let mut b4: u8 = (x3 / 16777216) as u8; + let mut x4: u64 = x3 - b4 as u64 * 16777216; + let mut b5: u8 = (x4 / 65536) as u8; + let mut x5: u64 = x4 - b5 as u64 * 65536; + let mut b6: u8 = (x5 / 256) as u8; + let mut b7: u8 = (x5 % 256) as u8; + ::dafny_runtime::seq![b0, b1, b2, b3, b4, b5, b6, b7] + } + pub fn SeqToUInt64(s: &::dafny_runtime::Sequence) -> u64 { + let mut x0: u64 = s.get(&::dafny_runtime::int!(0)) as u64 * 72057594037927936; + let mut x1: u64 = x0 + s.get(&::dafny_runtime::int!(1)) as u64 * 281474976710656; + let mut x2: u64 = x1 + s.get(&::dafny_runtime::int!(2)) as u64 * 1099511627776; + let mut x3: u64 = x2 + s.get(&::dafny_runtime::int!(3)) as u64 * 4294967296; + let mut x4: u64 = x3 + s.get(&::dafny_runtime::int!(4)) as u64 * 16777216; + let mut x5: u64 = x4 + s.get(&::dafny_runtime::int!(5)) as u64 * 65536; + let mut x6: u64 = x5 + s.get(&::dafny_runtime::int!(6)) as u64 * 256; + let mut x: u64 = x6 + s.get(&::dafny_runtime::int!(7)) as u64; + x + } + pub fn UINT16_LIMIT() -> ::dafny_runtime::DafnyInt { + ::dafny_runtime::int!(b"65536") + } + pub fn UINT32_LIMIT() -> ::dafny_runtime::DafnyInt { + ::dafny_runtime::int!(b"4294967296") + } + pub fn UINT64_LIMIT() -> ::dafny_runtime::DafnyInt { + ::dafny_runtime::int!(b"18446744073709551616") + } + pub fn INT32_MAX_LIMIT() -> ::dafny_runtime::DafnyInt { + ::dafny_runtime::int!(b"2147483648") + } + pub fn INT64_MAX_LIMIT() -> ::dafny_runtime::DafnyInt { + ::dafny_runtime::int!(b"9223372036854775808") + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct uint8(pub u8); + + impl uint8 { + pub fn is(_source: u8) -> bool { + return true; + } + } + + impl Default for uint8 { + fn default() -> Self { + uint8(::std::default::Default::default()) + } + } + + impl DafnyPrint for uint8 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for uint8 { + type Target = u8; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct uint16(pub u16); + + impl uint16 { + pub fn is(_source: u16) -> bool { + return true; + } + } + + impl Default for uint16 { + fn default() -> Self { + uint16(::std::default::Default::default()) + } + } + + impl DafnyPrint for uint16 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for uint16 { + type Target = u16; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct uint32(pub u32); + + impl uint32 { + pub fn is(_source: u32) -> bool { + return true; + } + } + + impl Default for uint32 { + fn default() -> Self { + uint32(::std::default::Default::default()) + } + } + + impl DafnyPrint for uint32 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for uint32 { + type Target = u32; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct uint64(pub u64); + + impl uint64 { + pub fn is(_source: u64) -> bool { + return true; + } + } + + impl Default for uint64 { + fn default() -> Self { + uint64(::std::default::Default::default()) + } + } + + impl DafnyPrint for uint64 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for uint64 { + type Target = u64; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct int32(pub i32); + + impl int32 { + pub fn is(_source: i32) -> bool { + return true; + } + } + + impl Default for int32 { + fn default() -> Self { + int32(::std::default::Default::default()) + } + } + + impl DafnyPrint for int32 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for int32 { + type Target = i32; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct int64(pub i64); + + impl int64 { + pub fn is(_source: i64) -> bool { + return true; + } + } + + impl Default for int64 { + fn default() -> Self { + int64(::std::default::Default::default()) + } + } + + impl DafnyPrint for int64 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for int64 { + type Target = i64; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + #[derive(Clone, PartialEq)] + #[repr(transparent)] + pub struct posInt64(pub u64); + + impl posInt64 { + pub fn is(_source: u64) -> bool { + let mut x: ::dafny_runtime::DafnyInt = + ::std::convert::Into::<::dafny_runtime::DafnyInt>::into(_source.clone()); + return ::dafny_runtime::int!(0) < x.clone() + && x.clone() < ::dafny_runtime::int!(b"9223372036854775808"); + } + } + + impl Default for posInt64 { + fn default() -> Self { + posInt64(1) + } + } + + impl DafnyPrint for posInt64 { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + in_seq: bool, + ) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) + } + } + + impl ::std::ops::Deref for posInt64 { + type Target = u64; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + pub type seq16 = ::dafny_runtime::Sequence; + + pub type seq32 = ::dafny_runtime::Sequence; + + pub type seq64 = ::dafny_runtime::Sequence; + } +} +pub mod UTF8 { + pub struct _default {} + + impl _default { + pub fn CreateEncodeSuccess( + bytes: &crate::UTF8::ValidUTF8Bytes, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + crate::UTF8::ValidUTF8Bytes, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + crate::UTF8::ValidUTF8Bytes, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Success { + value: bytes.clone(), + }) + } + pub fn CreateEncodeFailure( + error: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + crate::UTF8::ValidUTF8Bytes, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + crate::UTF8::ValidUTF8Bytes, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Failure { + error: error.clone(), + }) + } + pub fn CreateDecodeSuccess( + s: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Success { + value: s.clone(), + }) + } + pub fn CreateDecodeFailure( + error: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> ::std::rc::Rc< + crate::r#_Wrappers_Compile::Result< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >::Failure { + error: error.clone(), + }) + } + pub fn IsASCIIString( + s: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + let mut _hresult: bool = ::default(); + let mut _hi0: ::dafny_runtime::DafnyInt = s.cardinality(); + for i in ::dafny_runtime::integer_range(::dafny_runtime::int!(0), _hi0.clone()) { + if !(::dafny_runtime::int!(s.get(&i).0) < ::dafny_runtime::int!(128)) { + _hresult = false; + return _hresult; + } + } + _hresult = true; + return _hresult; + } + pub fn EncodeAscii( + s: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> crate::UTF8::ValidUTF8Bytes { + let mut _accumulator: crate::UTF8::ValidUTF8Bytes = + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence; + let mut s = s.clone(); + let mut _accumulator = _accumulator.clone(); + 'TAIL_CALL_START: loop { + if s.cardinality() == ::dafny_runtime::int!(0) { + return _accumulator + .concat(&(::dafny_runtime::seq![] as ::dafny_runtime::Sequence)); + } else { + let mut x: ::dafny_runtime::Sequence = + ::dafny_runtime::seq![s.get(&::dafny_runtime::int!(0)).0 as u8]; + _accumulator = _accumulator.concat(&x); + let mut _in11: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> = + s.drop(&::dafny_runtime::int!(1)); + s = _in11.clone(); + continue 'TAIL_CALL_START; + } + } + } + pub fn Uses1Byte(s: &::dafny_runtime::Sequence) -> bool { + 0 <= s.get(&::dafny_runtime::int!(0)) && s.get(&::dafny_runtime::int!(0)) <= 127 + } + pub fn Uses2Bytes(s: &::dafny_runtime::Sequence) -> bool { + 194 <= s.get(&::dafny_runtime::int!(0)) + && s.get(&::dafny_runtime::int!(0)) <= 223 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + } + pub fn Uses3Bytes(s: &::dafny_runtime::Sequence) -> bool { + s.get(&::dafny_runtime::int!(0)) == 224 + && (160 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + || 225 <= s.get(&::dafny_runtime::int!(0)) + && s.get(&::dafny_runtime::int!(0)) <= 236 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + || s.get(&::dafny_runtime::int!(0)) == 237 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 159) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + || 238 <= s.get(&::dafny_runtime::int!(0)) + && s.get(&::dafny_runtime::int!(0)) <= 239 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + } + pub fn Uses4Bytes(s: &::dafny_runtime::Sequence) -> bool { + s.get(&::dafny_runtime::int!(0)) == 240 + && (144 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(3)) + && s.get(&::dafny_runtime::int!(3)) <= 191) + || 241 <= s.get(&::dafny_runtime::int!(0)) + && s.get(&::dafny_runtime::int!(0)) <= 243 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(3)) + && s.get(&::dafny_runtime::int!(3)) <= 191) + || s.get(&::dafny_runtime::int!(0)) == 244 + && (128 <= s.get(&::dafny_runtime::int!(1)) + && s.get(&::dafny_runtime::int!(1)) <= 143) + && (128 <= s.get(&::dafny_runtime::int!(2)) + && s.get(&::dafny_runtime::int!(2)) <= 191) + && (128 <= s.get(&::dafny_runtime::int!(3)) + && s.get(&::dafny_runtime::int!(3)) <= 191) + } + pub fn ValidUTF8Range( + a: &::dafny_runtime::Sequence, + lo: &::dafny_runtime::_System::nat, + hi: &::dafny_runtime::_System::nat, + ) -> bool { + let mut a = a.clone(); + let mut lo = lo.clone(); + let mut hi = hi.clone(); + 'TAIL_CALL_START: loop { + if lo.clone() == hi.clone() { + return true; + } else { + let mut r: ::dafny_runtime::Sequence = a.slice(&lo, &hi); + if crate::UTF8::_default::Uses1Byte(&r) { + let mut _in12: ::dafny_runtime::Sequence = a.clone(); + let mut _in13: ::dafny_runtime::DafnyInt = + lo.clone() + ::dafny_runtime::int!(1); + let mut _in14: ::dafny_runtime::_System::nat = hi.clone(); + a = _in12.clone(); + lo = _in13.clone(); + hi = _in14.clone(); + continue 'TAIL_CALL_START; + } else { + if ::dafny_runtime::int!(2) <= r.cardinality() + && crate::UTF8::_default::Uses2Bytes(&r) + { + let mut _in15: ::dafny_runtime::Sequence = a.clone(); + let mut _in16: ::dafny_runtime::DafnyInt = + lo.clone() + ::dafny_runtime::int!(2); + let mut _in17: ::dafny_runtime::_System::nat = hi.clone(); + a = _in15.clone(); + lo = _in16.clone(); + hi = _in17.clone(); + continue 'TAIL_CALL_START; + } else { + if ::dafny_runtime::int!(3) <= r.cardinality() + && crate::UTF8::_default::Uses3Bytes(&r) + { + let mut _in18: ::dafny_runtime::Sequence = a.clone(); + let mut _in19: ::dafny_runtime::DafnyInt = + lo.clone() + ::dafny_runtime::int!(3); + let mut _in20: ::dafny_runtime::_System::nat = hi.clone(); + a = _in18.clone(); + lo = _in19.clone(); + hi = _in20.clone(); + continue 'TAIL_CALL_START; + } else { + if ::dafny_runtime::int!(4) <= r.cardinality() + && crate::UTF8::_default::Uses4Bytes(&r) + { + let mut _in21: ::dafny_runtime::Sequence = a.clone(); + let mut _in22: ::dafny_runtime::DafnyInt = + lo.clone() + ::dafny_runtime::int!(4); + let mut _in23: ::dafny_runtime::_System::nat = hi.clone(); + a = _in21.clone(); + lo = _in22.clone(); + hi = _in23.clone(); + continue 'TAIL_CALL_START; + } else { + return false; + } + } + } + } + } + } + } + pub fn ValidUTF8Seq(s: &::dafny_runtime::Sequence) -> bool { + crate::UTF8::_default::ValidUTF8Range(s, &::dafny_runtime::int!(0), &s.cardinality()) + } + } + + pub type ValidUTF8Bytes = ::dafny_runtime::Sequence; + + pub fn r#__init_ValidUTF8Bytes() -> ::dafny_runtime::Sequence { + ::dafny_runtime::seq![] as ::dafny_runtime::Sequence + } +} +pub mod software { + pub mod amazon { + pub mod cryptography { + pub mod services { + pub mod dynamodb { + pub mod internaldafny { + pub use dafny_runtime::DafnyPrint; + pub use std::cmp::Eq; + pub use std::convert::AsRef; + pub use std::default::Default; + pub use std::fmt::Debug; + pub use std::hash::Hash; + + pub struct _default {} + + impl _default { + pub fn DefaultDynamoDBClientConfigType() -> ::std::rc::Rc{ + ::std::rc::Rc::new(crate::software::amazon::cryptography::services::dynamodb::internaldafny::DynamoDBClientConfigType::DynamoDBClientConfigType {}) + } + pub fn CreateSuccessOfClient(client: &::dafny_runtime::Object) -> ::std::rc::Rc, ::std::rc::Rc>>{ + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::<::dafny_runtime::Object, ::std::rc::Rc>::Success { + value: client.clone() + }) + } + pub fn CreateFailureOfError(error: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>{ + ::std::rc::Rc::new(crate::r#_Wrappers_Compile::Result::<::dafny_runtime::Object, ::std::rc::Rc>::Failure { + error: error.clone() + }) + } + } + + #[derive(PartialEq, Clone)] + pub enum DynamoDBClientConfigType { + DynamoDBClientConfigType {}, + } + + impl DynamoDBClientConfigType {} + + impl Debug for DynamoDBClientConfigType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for DynamoDBClientConfigType { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DynamoDBClientConfigType::DynamoDBClientConfigType {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.DynamoDBClientConfigType.DynamoDBClientConfigType")?; + Ok(()) + } + } + } + } + + impl Eq for DynamoDBClientConfigType {} + + impl Hash for DynamoDBClientConfigType { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DynamoDBClientConfigType::DynamoDBClientConfigType {} => {} + } + } + } + + impl Default for DynamoDBClientConfigType { + fn default() -> DynamoDBClientConfigType { + DynamoDBClientConfigType::DynamoDBClientConfigType {} + } + } + + impl AsRef for &DynamoDBClientConfigType { + fn as_ref(&self) -> Self { + self + } + } + + pub mod types { + pub use dafny_runtime::DafnyPrint; + pub use dafny_runtime::UpcastObject; + pub use std::any::Any; + pub use std::cmp::Eq; + pub use std::convert::AsRef; + pub use std::default::Default; + pub use std::fmt::Debug; + pub use std::hash::Hash; + + pub struct _default {} + + impl _default { + pub fn IsValid_AttributeName( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(0) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(b"65535") + } + pub fn IsValid_AttributeNameList( + x: &::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + } + pub fn IsValid_BackupArn( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(37) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(1024) + } + pub fn IsValid_BatchGetRequestMap( + x: &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(100) + } + pub fn IsValid_CancellationReasonList( + x: &::dafny_runtime::Sequence<::std::rc::Rc>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(25) + } + pub fn IsValid_ClientRequestToken( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(36) + } + pub fn IsValid_ConsumedCapacityUnits( + x: &::dafny_runtime::Sequence, + ) -> bool { + ::dafny_runtime::int!(8) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(8) + } + pub fn IsValid_IndexName( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(3) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(255) + } + pub fn IsValid_ItemCollectionSizeEstimateBound( + x: &::dafny_runtime::Sequence, + ) -> bool { + ::dafny_runtime::int!(8) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(8) + } + pub fn IsValid_KeyList( + x: &::dafny_runtime::Sequence<::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(100) + } + pub fn IsValid_KeySchema( + x: &::dafny_runtime::Sequence<::std::rc::Rc>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(2) + } + pub fn IsValid_KeySchemaAttributeName( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(255) + } + pub fn IsValid_NonKeyAttributeName( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(255) + } + pub fn IsValid_NonKeyAttributeNameList( + x: &::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(20) + } + pub fn IsValid_NonNegativeLongObject(x: i64) -> bool { + 0 <= x + } + pub fn IsValid_PositiveIntegerObject(x: i32) -> bool { + 1 <= x + } + pub fn IsValid_PositiveLongObject(x: i64) -> bool { + 1 <= x + } + pub fn IsValid_ScanSegment(x: i32) -> bool { + 0 <= x && x <= 999999 + } + pub fn IsValid_ScanTotalSegments(x: i32) -> bool { + 1 <= x && x <= 1000000 + } + pub fn IsValid_StreamArn( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(37) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(1024) + } + pub fn IsValid_TableName( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(3) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(255) + } + pub fn IsValid_TagKeyString( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(128) + } + pub fn IsValid_TagValueString( + x: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) -> bool { + ::dafny_runtime::int!(0) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(256) + } + pub fn IsValid_TransactWriteItemList( + x: &::dafny_runtime::Sequence<::std::rc::Rc>, + ) -> bool { + ::dafny_runtime::int!(1) <= x.cardinality() + && x.cardinality() <= ::dafny_runtime::int!(25) + } + } + + #[derive(PartialEq, Clone)] + pub enum DafnyCallEvent< + I: ::dafny_runtime::DafnyType, + O: ::dafny_runtime::DafnyType, + > { + DafnyCallEvent { input: I, output: O }, + } + + impl DafnyCallEvent { + pub fn input(&self) -> &I { + match self { + DafnyCallEvent::DafnyCallEvent { input, output } => input, + } + } + pub fn output(&self) -> &O { + match self { + DafnyCallEvent::DafnyCallEvent { input, output } => output, + } + } + } + + impl Debug for DafnyCallEvent { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl + DafnyPrint for DafnyCallEvent + { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DafnyCallEvent::DafnyCallEvent { input, output } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + input, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + output, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl< + I: ::dafny_runtime::DafnyType + Eq, + O: ::dafny_runtime::DafnyType + Eq, + > Eq for DafnyCallEvent + { + } + + impl< + I: ::dafny_runtime::DafnyType + Hash, + O: ::dafny_runtime::DafnyType + Hash, + > Hash for DafnyCallEvent + { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DafnyCallEvent::DafnyCallEvent { input, output } => { + ::std::hash::Hash::hash(input, _state); + ::std::hash::Hash::hash(output, _state) + } + } + } + } + + impl< + I: ::dafny_runtime::DafnyType + Default, + O: ::dafny_runtime::DafnyType + Default, + > Default for DafnyCallEvent + { + fn default() -> DafnyCallEvent { + DafnyCallEvent::DafnyCallEvent { + input: ::std::default::Default::default(), + output: ::std::default::Default::default(), + } + } + } + + impl + AsRef> for &DafnyCallEvent + { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ArchivalSummary { + ArchivalSummary { + ArchivalDateTime: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + ArchivalReason: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + ArchivalBackupArn: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + }, + } + + impl ArchivalSummary { + pub fn ArchivalDateTime( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime, + ArchivalReason, + ArchivalBackupArn, + } => ArchivalDateTime, + } + } + pub fn ArchivalReason( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime, + ArchivalReason, + ArchivalBackupArn, + } => ArchivalReason, + } + } + pub fn ArchivalBackupArn( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime, + ArchivalReason, + ArchivalBackupArn, + } => ArchivalBackupArn, + } + } + } + + impl Debug for ArchivalSummary { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ArchivalSummary { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime, + ArchivalReason, + ArchivalBackupArn, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ArchivalSummary.ArchivalSummary(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ArchivalDateTime, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ArchivalReason, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ArchivalBackupArn, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ArchivalSummary {} + + impl Hash for ArchivalSummary { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime, + ArchivalReason, + ArchivalBackupArn, + } => { + ::std::hash::Hash::hash(ArchivalDateTime, _state); + ::std::hash::Hash::hash(ArchivalReason, _state); + ::std::hash::Hash::hash(ArchivalBackupArn, _state) + } + } + } + } + + impl Default for ArchivalSummary { + fn default() -> ArchivalSummary { + ArchivalSummary::ArchivalSummary { + ArchivalDateTime: ::std::default::Default::default(), + ArchivalReason: ::std::default::Default::default(), + ArchivalBackupArn: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ArchivalSummary { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum AttributeAction { + ADD {}, + PUT {}, + DELETE {}, + } + + impl AttributeAction {} + + impl Debug for AttributeAction { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for AttributeAction { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + AttributeAction::ADD {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.ADD")?; + Ok(()) + } + AttributeAction::PUT {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.PUT")?; + Ok(()) + } + AttributeAction::DELETE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.DELETE")?; + Ok(()) + } + } + } + } + + impl Eq for AttributeAction {} + + impl Hash for AttributeAction { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + AttributeAction::ADD {} => {} + AttributeAction::PUT {} => {} + AttributeAction::DELETE {} => {} + } + } + } + + impl Default for AttributeAction { + fn default() -> AttributeAction { + AttributeAction::ADD {} + } + } + + impl AsRef for &AttributeAction { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum AttributeDefinition { + AttributeDefinition { + AttributeName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + AttributeType: ::std::rc::Rc + } + } + + impl AttributeDefinition { + pub fn AttributeName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + AttributeDefinition::AttributeDefinition { + AttributeName, + AttributeType, + } => AttributeName, + } + } + pub fn AttributeType(&self) -> &::std::rc::Rc{ + match self { + AttributeDefinition::AttributeDefinition { + AttributeName, + AttributeType, + } => AttributeType, + } + } + } + + impl Debug for AttributeDefinition { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for AttributeDefinition { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + AttributeDefinition::AttributeDefinition { + AttributeName, + AttributeType, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeDefinition.AttributeDefinition(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeName, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeType, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for AttributeDefinition {} + + impl Hash for AttributeDefinition { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + AttributeDefinition::AttributeDefinition { + AttributeName, + AttributeType, + } => { + ::std::hash::Hash::hash(AttributeName, _state); + ::std::hash::Hash::hash(AttributeType, _state) + } + } + } + } + + impl Default for AttributeDefinition { + fn default() -> AttributeDefinition { + AttributeDefinition::AttributeDefinition { + AttributeName: ::std::default::Default::default(), + AttributeType: ::std::default::Default::default(), + } + } + } + + impl AsRef for &AttributeDefinition { + fn as_ref(&self) -> Self { + self + } + } + + pub type AttributeName = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + pub type AttributeNameList = ::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >; + + #[derive(PartialEq, Clone)] + pub enum AttributeValue { + S { + S: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + }, + N { + N: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + }, + B { + B: ::dafny_runtime::Sequence + }, + SS { + SS: ::dafny_runtime::Sequence<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>> + }, + NS { + NS: ::dafny_runtime::Sequence<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>> + }, + BS { + BS: ::dafny_runtime::Sequence<::dafny_runtime::Sequence> + }, + M { + M: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc> + }, + L { + L: ::dafny_runtime::Sequence<::std::rc::Rc> + }, + NULL { + NULL: bool + }, + BOOL { + BOOL: bool + } + } + + impl AttributeValue { + pub fn S( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + AttributeValue::S { S } => S, + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn N( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => N, + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn B(&self) -> &::dafny_runtime::Sequence { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => B, + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn SS( + &self, + ) -> &::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + > { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => SS, + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn NS( + &self, + ) -> &::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + > { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => NS, + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn BS( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::Sequence> + { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => BS, + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn M(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => M, + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn L(&self) -> &::dafny_runtime::Sequence<::std::rc::Rc>{ + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => L, + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn NULL(&self) -> &bool { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => NULL, + AttributeValue::BOOL { BOOL } => { + panic!("field does not exist on this variant") + } + } + } + pub fn BOOL(&self) -> &bool { + match self { + AttributeValue::S { S } => { + panic!("field does not exist on this variant") + } + AttributeValue::N { N } => { + panic!("field does not exist on this variant") + } + AttributeValue::B { B } => { + panic!("field does not exist on this variant") + } + AttributeValue::SS { SS } => { + panic!("field does not exist on this variant") + } + AttributeValue::NS { NS } => { + panic!("field does not exist on this variant") + } + AttributeValue::BS { BS } => { + panic!("field does not exist on this variant") + } + AttributeValue::M { M } => { + panic!("field does not exist on this variant") + } + AttributeValue::L { L } => { + panic!("field does not exist on this variant") + } + AttributeValue::NULL { NULL } => { + panic!("field does not exist on this variant") + } + AttributeValue::BOOL { BOOL } => BOOL, + } + } + } + + impl Debug for AttributeValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for AttributeValue { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + AttributeValue::S { S } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.S(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + S, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::N { N } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.N(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + N, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::B { B } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.B(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + B, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::SS { SS } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.SS(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + SS, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::NS { NS } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.NS(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + NS, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::BS { BS } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.BS(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + BS, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::M { M } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.M(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + M, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::L { L } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.L(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + L, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::NULL { NULL } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.NULL(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + NULL, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + AttributeValue::BOOL { BOOL } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.BOOL(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + BOOL, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for AttributeValue {} + + impl Hash for AttributeValue { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + AttributeValue::S { S } => { + ::std::hash::Hash::hash(S, _state) + } + AttributeValue::N { N } => { + ::std::hash::Hash::hash(N, _state) + } + AttributeValue::B { B } => { + ::std::hash::Hash::hash(B, _state) + } + AttributeValue::SS { SS } => { + ::std::hash::Hash::hash(SS, _state) + } + AttributeValue::NS { NS } => { + ::std::hash::Hash::hash(NS, _state) + } + AttributeValue::BS { BS } => { + ::std::hash::Hash::hash(BS, _state) + } + AttributeValue::M { M } => { + ::std::hash::Hash::hash(M, _state) + } + AttributeValue::L { L } => { + ::std::hash::Hash::hash(L, _state) + } + AttributeValue::NULL { NULL } => { + ::std::hash::Hash::hash(NULL, _state) + } + AttributeValue::BOOL { BOOL } => { + ::std::hash::Hash::hash(BOOL, _state) + } + } + } + } + + impl Default for AttributeValue { + fn default() -> AttributeValue { + AttributeValue::S { + S: ::std::default::Default::default(), + } + } + } + + impl AsRef for &AttributeValue { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum AttributeValueUpdate { + AttributeValueUpdate { + Value: ::std::rc::Rc>>, + Action: ::std::rc::Rc>> + } + } + + impl AttributeValueUpdate { + pub fn Value(&self) -> &::std::rc::Rc>>{ + match self { + AttributeValueUpdate::AttributeValueUpdate { + Value, + Action, + } => Value, + } + } + pub fn Action(&self) -> &::std::rc::Rc>>{ + match self { + AttributeValueUpdate::AttributeValueUpdate { + Value, + Action, + } => Action, + } + } + } + + impl Debug for AttributeValueUpdate { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for AttributeValueUpdate { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + AttributeValueUpdate::AttributeValueUpdate { + Value, + Action, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValueUpdate.AttributeValueUpdate(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Value, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Action, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for AttributeValueUpdate {} + + impl Hash for AttributeValueUpdate { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + AttributeValueUpdate::AttributeValueUpdate { + Value, + Action, + } => { + ::std::hash::Hash::hash(Value, _state); + ::std::hash::Hash::hash(Action, _state) + } + } + } + } + + impl Default for AttributeValueUpdate { + fn default() -> AttributeValueUpdate { + AttributeValueUpdate::AttributeValueUpdate { + Value: ::std::default::Default::default(), + Action: ::std::default::Default::default(), + } + } + } + + impl AsRef for &AttributeValueUpdate { + fn as_ref(&self) -> Self { + self + } + } + + pub type BackupArn = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + #[derive(PartialEq, Clone)] + pub enum BatchGetItemInput { + BatchGetItemInput { + RequestItems: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap, + ReturnConsumedCapacity: ::std::rc::Rc>> + } + } + + impl BatchGetItemInput { + pub fn RequestItems(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap{ + match self { + BatchGetItemInput::BatchGetItemInput { + RequestItems, + ReturnConsumedCapacity, + } => RequestItems, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + BatchGetItemInput::BatchGetItemInput { + RequestItems, + ReturnConsumedCapacity, + } => ReturnConsumedCapacity, + } + } + } + + impl Debug for BatchGetItemInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for BatchGetItemInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + BatchGetItemInput::BatchGetItemInput { + RequestItems, + ReturnConsumedCapacity, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemInput.BatchGetItemInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + RequestItems, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for BatchGetItemInput {} + + impl Hash for BatchGetItemInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + BatchGetItemInput::BatchGetItemInput { + RequestItems, + ReturnConsumedCapacity, + } => { + ::std::hash::Hash::hash(RequestItems, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state) + } + } + } + } + + impl Default for BatchGetItemInput { + fn default() -> BatchGetItemInput { + BatchGetItemInput::BatchGetItemInput { + RequestItems: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + } + } + } + + impl AsRef for &BatchGetItemInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum BatchGetItemOutput { + BatchGetItemOutput { + Responses: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>>>>>, + UnprocessedKeys: ::std::rc::Rc>, + ConsumedCapacity: ::std::rc::Rc>>> + } + } + + impl BatchGetItemOutput { + pub fn Responses(&self) -> &::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>>>>>{ + match self { + BatchGetItemOutput::BatchGetItemOutput { + Responses, + UnprocessedKeys, + ConsumedCapacity, + } => Responses, + } + } + pub fn UnprocessedKeys(&self) -> &::std::rc::Rc>{ + match self { + BatchGetItemOutput::BatchGetItemOutput { + Responses, + UnprocessedKeys, + ConsumedCapacity, + } => UnprocessedKeys, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>>{ + match self { + BatchGetItemOutput::BatchGetItemOutput { + Responses, + UnprocessedKeys, + ConsumedCapacity, + } => ConsumedCapacity, + } + } + } + + impl Debug for BatchGetItemOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for BatchGetItemOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + BatchGetItemOutput::BatchGetItemOutput { + Responses, + UnprocessedKeys, + ConsumedCapacity, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemOutput.BatchGetItemOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Responses, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + UnprocessedKeys, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for BatchGetItemOutput {} + + impl Hash for BatchGetItemOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + BatchGetItemOutput::BatchGetItemOutput { + Responses, + UnprocessedKeys, + ConsumedCapacity, + } => { + ::std::hash::Hash::hash(Responses, _state); + ::std::hash::Hash::hash(UnprocessedKeys, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state) + } + } + } + } + + impl Default for BatchGetItemOutput { + fn default() -> BatchGetItemOutput { + BatchGetItemOutput::BatchGetItemOutput { + Responses: ::std::default::Default::default(), + UnprocessedKeys: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + } + } + } + + impl AsRef for &BatchGetItemOutput { + fn as_ref(&self) -> Self { + self + } + } + + pub type BatchGetRequestMap = ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>; + + #[derive(PartialEq, Clone)] + pub enum BillingMode { + PROVISIONED {}, + PAY_PER_REQUEST {}, + } + + impl BillingMode {} + + impl Debug for BillingMode { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for BillingMode { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + BillingMode::PROVISIONED {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode.PROVISIONED")?; + Ok(()) + } + BillingMode::PAY_PER_REQUEST {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode.PAY__PER__REQUEST")?; + Ok(()) + } + } + } + } + + impl Eq for BillingMode {} + + impl Hash for BillingMode { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + BillingMode::PROVISIONED {} => {} + BillingMode::PAY_PER_REQUEST {} => {} + } + } + } + + impl Default for BillingMode { + fn default() -> BillingMode { + BillingMode::PROVISIONED {} + } + } + + impl AsRef for &BillingMode { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum BillingModeSummary { + BillingModeSummary { + BillingMode: ::std::rc::Rc>>, + LastUpdateToPayPerRequestDateTime: ::std::rc::Rc>> + } + } + + impl BillingModeSummary { + pub fn BillingMode(&self) -> &::std::rc::Rc>>{ + match self { + BillingModeSummary::BillingModeSummary { + BillingMode, + LastUpdateToPayPerRequestDateTime, + } => BillingMode, + } + } + pub fn LastUpdateToPayPerRequestDateTime( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + BillingModeSummary::BillingModeSummary { + BillingMode, + LastUpdateToPayPerRequestDateTime, + } => LastUpdateToPayPerRequestDateTime, + } + } + } + + impl Debug for BillingModeSummary { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for BillingModeSummary { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + BillingModeSummary::BillingModeSummary { + BillingMode, + LastUpdateToPayPerRequestDateTime, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingModeSummary.BillingModeSummary(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + BillingMode, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + LastUpdateToPayPerRequestDateTime, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for BillingModeSummary {} + + impl Hash for BillingModeSummary { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + BillingModeSummary::BillingModeSummary { + BillingMode, + LastUpdateToPayPerRequestDateTime, + } => { + ::std::hash::Hash::hash(BillingMode, _state); + ::std::hash::Hash::hash( + LastUpdateToPayPerRequestDateTime, + _state, + ) + } + } + } + } + + impl Default for BillingModeSummary { + fn default() -> BillingModeSummary { + BillingModeSummary::BillingModeSummary { + BillingMode: ::std::default::Default::default(), + LastUpdateToPayPerRequestDateTime: + ::std::default::Default::default(), + } + } + } + + impl AsRef for &BillingModeSummary { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum CancellationReason { + CancellationReason { + Item: ::std::rc::Rc, ::std::rc::Rc>>>, + Code: ::std::rc::Rc>>, + Message: ::std::rc::Rc>> + } + } + + impl CancellationReason { + pub fn Item(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + CancellationReason::CancellationReason { + Item, + Code, + Message, + } => Item, + } + } + pub fn Code( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + CancellationReason::CancellationReason { + Item, + Code, + Message, + } => Code, + } + } + pub fn Message( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + CancellationReason::CancellationReason { + Item, + Code, + Message, + } => Message, + } + } + } + + impl Debug for CancellationReason { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for CancellationReason { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + CancellationReason::CancellationReason { + Item, + Code, + Message, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CancellationReason.CancellationReason(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Item, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Code, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Message, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for CancellationReason {} + + impl Hash for CancellationReason { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + CancellationReason::CancellationReason { + Item, + Code, + Message, + } => { + ::std::hash::Hash::hash(Item, _state); + ::std::hash::Hash::hash(Code, _state); + ::std::hash::Hash::hash(Message, _state) + } + } + } + } + + impl Default for CancellationReason { + fn default() -> CancellationReason { + CancellationReason::CancellationReason { + Item: ::std::default::Default::default(), + Code: ::std::default::Default::default(), + Message: ::std::default::Default::default(), + } + } + } + + impl AsRef for &CancellationReason { + fn as_ref(&self) -> Self { + self + } + } + + pub type CancellationReasonList = ::dafny_runtime::Sequence<::std::rc::Rc>; + + #[derive(PartialEq, Clone)] + pub enum Capacity { + Capacity { + ReadCapacityUnits: ::std::rc::Rc>, + WriteCapacityUnits: ::std::rc::Rc>, + CapacityUnits: ::std::rc::Rc> + } + } + + impl Capacity { + pub fn ReadCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + Capacity::Capacity { + ReadCapacityUnits, + WriteCapacityUnits, + CapacityUnits, + } => ReadCapacityUnits, + } + } + pub fn WriteCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + Capacity::Capacity { + ReadCapacityUnits, + WriteCapacityUnits, + CapacityUnits, + } => WriteCapacityUnits, + } + } + pub fn CapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + Capacity::Capacity { + ReadCapacityUnits, + WriteCapacityUnits, + CapacityUnits, + } => CapacityUnits, + } + } + } + + impl Debug for Capacity { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Capacity { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Capacity::Capacity { + ReadCapacityUnits, + WriteCapacityUnits, + CapacityUnits, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Capacity.Capacity(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReadCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + WriteCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + CapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Capacity {} + + impl Hash for Capacity { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Capacity::Capacity { + ReadCapacityUnits, + WriteCapacityUnits, + CapacityUnits, + } => { + ::std::hash::Hash::hash(ReadCapacityUnits, _state); + ::std::hash::Hash::hash(WriteCapacityUnits, _state); + ::std::hash::Hash::hash(CapacityUnits, _state) + } + } + } + } + + impl Default for Capacity { + fn default() -> Capacity { + Capacity::Capacity { + ReadCapacityUnits: ::std::default::Default::default(), + WriteCapacityUnits: ::std::default::Default::default(), + CapacityUnits: ::std::default::Default::default(), + } + } + } + + impl AsRef for &Capacity { + fn as_ref(&self) -> Self { + self + } + } + + pub type ClientRequestToken = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + #[derive(PartialEq, Clone)] + pub enum ComparisonOperator { + EQ {}, + NE {}, + IN {}, + LE {}, + LT {}, + GE {}, + GT {}, + BETWEEN {}, + NOT_NULL {}, + NULL {}, + CONTAINS {}, + NOT_CONTAINS {}, + BEGINS_WITH {}, + } + + impl ComparisonOperator {} + + impl Debug for ComparisonOperator { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ComparisonOperator { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ComparisonOperator::EQ {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.EQ")?; + Ok(()) + } + ComparisonOperator::NE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NE")?; + Ok(()) + } + ComparisonOperator::IN {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.IN")?; + Ok(()) + } + ComparisonOperator::LE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.LE")?; + Ok(()) + } + ComparisonOperator::LT {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.LT")?; + Ok(()) + } + ComparisonOperator::GE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.GE")?; + Ok(()) + } + ComparisonOperator::GT {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.GT")?; + Ok(()) + } + ComparisonOperator::BETWEEN {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.BETWEEN")?; + Ok(()) + } + ComparisonOperator::NOT_NULL {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NOT__NULL")?; + Ok(()) + } + ComparisonOperator::NULL {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NULL")?; + Ok(()) + } + ComparisonOperator::CONTAINS {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.CONTAINS")?; + Ok(()) + } + ComparisonOperator::NOT_CONTAINS {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NOT__CONTAINS")?; + Ok(()) + } + ComparisonOperator::BEGINS_WITH {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.BEGINS__WITH")?; + Ok(()) + } + } + } + } + + impl Eq for ComparisonOperator {} + + impl Hash for ComparisonOperator { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ComparisonOperator::EQ {} => {} + ComparisonOperator::NE {} => {} + ComparisonOperator::IN {} => {} + ComparisonOperator::LE {} => {} + ComparisonOperator::LT {} => {} + ComparisonOperator::GE {} => {} + ComparisonOperator::GT {} => {} + ComparisonOperator::BETWEEN {} => {} + ComparisonOperator::NOT_NULL {} => {} + ComparisonOperator::NULL {} => {} + ComparisonOperator::CONTAINS {} => {} + ComparisonOperator::NOT_CONTAINS {} => {} + ComparisonOperator::BEGINS_WITH {} => {} + } + } + } + + impl Default for ComparisonOperator { + fn default() -> ComparisonOperator { + ComparisonOperator::EQ {} + } + } + + impl AsRef for &ComparisonOperator { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum Condition { + Condition { + AttributeValueList: ::std::rc::Rc>>>, + ComparisonOperator: ::std::rc::Rc + } + } + + impl Condition { + pub fn AttributeValueList(&self) -> &::std::rc::Rc>>>{ + match self { + Condition::Condition { + AttributeValueList, + ComparisonOperator, + } => AttributeValueList, + } + } + pub fn ComparisonOperator(&self) -> &::std::rc::Rc{ + match self { + Condition::Condition { + AttributeValueList, + ComparisonOperator, + } => ComparisonOperator, + } + } + } + + impl Debug for Condition { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Condition { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Condition::Condition { + AttributeValueList, + ComparisonOperator, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition.Condition(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeValueList, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ComparisonOperator, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Condition {} + + impl Hash for Condition { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Condition::Condition { + AttributeValueList, + ComparisonOperator, + } => { + ::std::hash::Hash::hash(AttributeValueList, _state); + ::std::hash::Hash::hash(ComparisonOperator, _state) + } + } + } + } + + impl Default for Condition { + fn default() -> Condition { + Condition::Condition { + AttributeValueList: ::std::default::Default::default(), + ComparisonOperator: ::std::default::Default::default(), + } + } + } + + impl AsRef for &Condition { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ConditionalOperator { + AND {}, + OR {}, + } + + impl ConditionalOperator {} + + impl Debug for ConditionalOperator { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ConditionalOperator { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ConditionalOperator::AND {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator.AND")?; + Ok(()) + } + ConditionalOperator::OR {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator.OR")?; + Ok(()) + } + } + } + } + + impl Eq for ConditionalOperator {} + + impl Hash for ConditionalOperator { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ConditionalOperator::AND {} => {} + ConditionalOperator::OR {} => {} + } + } + } + + impl Default for ConditionalOperator { + fn default() -> ConditionalOperator { + ConditionalOperator::AND {} + } + } + + impl AsRef for &ConditionalOperator { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ConditionCheck { + ConditionCheck { + Key: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ConditionExpression: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc>> + } + } + + impl ConditionCheck { + pub fn Key(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => Key, + } + } + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => TableName, + } + } + pub fn ConditionExpression( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeValues, + } + } + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &::std::rc::Rc>>{ + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ReturnValuesOnConditionCheckFailure, + } + } + } + + impl Debug for ConditionCheck { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ConditionCheck { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionCheck.ConditionCheck(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Key, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnValuesOnConditionCheckFailure, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ConditionCheck {} + + impl Hash for ConditionCheck { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ConditionCheck::ConditionCheck { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + ::std::hash::Hash::hash(Key, _state); + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(ConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ); + ::std::hash::Hash::hash( + ReturnValuesOnConditionCheckFailure, + _state, + ) + } + } + } + } + + impl Default for ConditionCheck { + fn default() -> ConditionCheck { + ConditionCheck::ConditionCheck { + Key: ::std::default::Default::default(), + TableName: ::std::default::Default::default(), + ConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + ReturnValuesOnConditionCheckFailure: + ::std::default::Default::default(), + } + } + } + + impl AsRef for &ConditionCheck { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ConsumedCapacity { + ConsumedCapacity { + TableName: ::std::rc::Rc>>, + CapacityUnits: ::std::rc::Rc>, + ReadCapacityUnits: ::std::rc::Rc>, + WriteCapacityUnits: ::std::rc::Rc>, + Table: ::std::rc::Rc>>, + LocalSecondaryIndexes: ::std::rc::Rc, ::std::rc::Rc>>>, + GlobalSecondaryIndexes: ::std::rc::Rc, ::std::rc::Rc>>> + } + } + + impl ConsumedCapacity { + pub fn TableName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => TableName, + } + } + pub fn CapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => CapacityUnits, + } + } + pub fn ReadCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => ReadCapacityUnits, + } + } + pub fn WriteCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => WriteCapacityUnits, + } + } + pub fn Table(&self) -> &::std::rc::Rc>>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => Table, + } + } + pub fn LocalSecondaryIndexes(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => LocalSecondaryIndexes, + } + } + pub fn GlobalSecondaryIndexes(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => GlobalSecondaryIndexes, + } + } + } + + impl Debug for ConsumedCapacity { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ConsumedCapacity { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConsumedCapacity.ConsumedCapacity(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + CapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReadCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + WriteCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Table, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + LocalSecondaryIndexes, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + GlobalSecondaryIndexes, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ConsumedCapacity {} + + impl Hash for ConsumedCapacity { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ConsumedCapacity::ConsumedCapacity { + TableName, + CapacityUnits, + ReadCapacityUnits, + WriteCapacityUnits, + Table, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(CapacityUnits, _state); + ::std::hash::Hash::hash(ReadCapacityUnits, _state); + ::std::hash::Hash::hash(WriteCapacityUnits, _state); + ::std::hash::Hash::hash(Table, _state); + ::std::hash::Hash::hash(LocalSecondaryIndexes, _state); + ::std::hash::Hash::hash(GlobalSecondaryIndexes, _state) + } + } + } + } + + impl Default for ConsumedCapacity { + fn default() -> ConsumedCapacity { + ConsumedCapacity::ConsumedCapacity { + TableName: ::std::default::Default::default(), + CapacityUnits: ::std::default::Default::default(), + ReadCapacityUnits: ::std::default::Default::default(), + WriteCapacityUnits: ::std::default::Default::default(), + Table: ::std::default::Default::default(), + LocalSecondaryIndexes: ::std::default::Default::default(), + GlobalSecondaryIndexes: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ConsumedCapacity { + fn as_ref(&self) -> Self { + self + } + } + + pub type ConsumedCapacityUnits = ::dafny_runtime::Sequence; + + #[derive(PartialEq, Clone)] + pub enum CreateTableInput { + CreateTableInput { + AttributeDefinitions: ::dafny_runtime::Sequence<::std::rc::Rc>, + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + KeySchema: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema, + LocalSecondaryIndexes: ::std::rc::Rc>>>, + GlobalSecondaryIndexes: ::std::rc::Rc>>>, + BillingMode: ::std::rc::Rc>>, + ProvisionedThroughput: ::std::rc::Rc>>, + StreamSpecification: ::std::rc::Rc>>, + SSESpecification: ::std::rc::Rc>>, + Tags: ::std::rc::Rc>>>, + TableClass: ::std::rc::Rc>> + } + } + + impl CreateTableInput { + pub fn AttributeDefinitions(&self) -> &::dafny_runtime::Sequence<::std::rc::Rc>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => AttributeDefinitions, + } + } + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => TableName, + } + } + pub fn KeySchema(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => KeySchema, + } + } + pub fn LocalSecondaryIndexes(&self) -> &::std::rc::Rc>>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => LocalSecondaryIndexes, + } + } + pub fn GlobalSecondaryIndexes(&self) -> &::std::rc::Rc>>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => GlobalSecondaryIndexes, + } + } + pub fn BillingMode(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => BillingMode, + } + } + pub fn ProvisionedThroughput(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => ProvisionedThroughput, + } + } + pub fn StreamSpecification(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => StreamSpecification, + } + } + pub fn SSESpecification(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => SSESpecification, + } + } + pub fn Tags(&self) -> &::std::rc::Rc>>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => Tags, + } + } + pub fn TableClass(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => TableClass, + } + } + } + + impl Debug for CreateTableInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for CreateTableInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableInput.CreateTableInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeDefinitions, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeySchema, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + LocalSecondaryIndexes, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + GlobalSecondaryIndexes, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + BillingMode, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProvisionedThroughput, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + StreamSpecification, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + SSESpecification, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Tags, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableClass, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for CreateTableInput {} + + impl Hash for CreateTableInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + CreateTableInput::CreateTableInput { + AttributeDefinitions, + TableName, + KeySchema, + LocalSecondaryIndexes, + GlobalSecondaryIndexes, + BillingMode, + ProvisionedThroughput, + StreamSpecification, + SSESpecification, + Tags, + TableClass, + } => { + ::std::hash::Hash::hash(AttributeDefinitions, _state); + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(KeySchema, _state); + ::std::hash::Hash::hash(LocalSecondaryIndexes, _state); + ::std::hash::Hash::hash(GlobalSecondaryIndexes, _state); + ::std::hash::Hash::hash(BillingMode, _state); + ::std::hash::Hash::hash(ProvisionedThroughput, _state); + ::std::hash::Hash::hash(StreamSpecification, _state); + ::std::hash::Hash::hash(SSESpecification, _state); + ::std::hash::Hash::hash(Tags, _state); + ::std::hash::Hash::hash(TableClass, _state) + } + } + } + } + + impl Default for CreateTableInput { + fn default() -> CreateTableInput { + CreateTableInput::CreateTableInput { + AttributeDefinitions: ::std::default::Default::default(), + TableName: ::std::default::Default::default(), + KeySchema: ::std::default::Default::default(), + LocalSecondaryIndexes: ::std::default::Default::default(), + GlobalSecondaryIndexes: ::std::default::Default::default(), + BillingMode: ::std::default::Default::default(), + ProvisionedThroughput: ::std::default::Default::default(), + StreamSpecification: ::std::default::Default::default(), + SSESpecification: ::std::default::Default::default(), + Tags: ::std::default::Default::default(), + TableClass: ::std::default::Default::default(), + } + } + } + + impl AsRef for &CreateTableInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum CreateTableOutput { + CreateTableOutput { + TableDescription: ::std::rc::Rc>> + } + } + + impl CreateTableOutput { + pub fn TableDescription(&self) -> &::std::rc::Rc>>{ + match self { + CreateTableOutput::CreateTableOutput { + TableDescription, + } => TableDescription, + } + } + } + + impl Debug for CreateTableOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for CreateTableOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + CreateTableOutput::CreateTableOutput { + TableDescription, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableOutput.CreateTableOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableDescription, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for CreateTableOutput {} + + impl Hash for CreateTableOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + CreateTableOutput::CreateTableOutput { + TableDescription, + } => ::std::hash::Hash::hash(TableDescription, _state), + } + } + } + + impl Default for CreateTableOutput { + fn default() -> CreateTableOutput { + CreateTableOutput::CreateTableOutput { + TableDescription: ::std::default::Default::default(), + } + } + } + + impl AsRef for &CreateTableOutput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum Delete { + Delete { + Key: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ConditionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc>> + } + } + + impl Delete { + pub fn Key(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => Key, + } + } + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => TableName, + } + } + pub fn ConditionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeValues, + } + } + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &::std::rc::Rc>>{ + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ReturnValuesOnConditionCheckFailure, + } + } + } + + impl Debug for Delete { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Delete { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Delete.Delete(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Key, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnValuesOnConditionCheckFailure, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Delete {} + + impl Hash for Delete { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Delete::Delete { + Key, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + ::std::hash::Hash::hash(Key, _state); + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(ConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ); + ::std::hash::Hash::hash( + ReturnValuesOnConditionCheckFailure, + _state, + ) + } + } + } + } + + impl Default for Delete { + fn default() -> Delete { + Delete::Delete { + Key: ::std::default::Default::default(), + TableName: ::std::default::Default::default(), + ConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + ReturnValuesOnConditionCheckFailure: + ::std::default::Default::default(), + } + } + } + + impl AsRef for &Delete { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum DeleteItemInput { + DeleteItemInput { + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + Key: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + Expected: ::std::rc::Rc, ::std::rc::Rc>>>, + ConditionalOperator: ::std::rc::Rc>>, + ReturnValues: ::std::rc::Rc>>, + ReturnConsumedCapacity: ::std::rc::Rc>>, + ReturnItemCollectionMetrics: ::std::rc::Rc>>, + ConditionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>> + } + } + + impl DeleteItemInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => TableName, + } + } + pub fn Key(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Key, + } + } + pub fn Expected(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Expected, + } + } + pub fn ConditionalOperator(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConditionalOperator, + } + } + pub fn ReturnValues(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnValues, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnConsumedCapacity, + } + } + pub fn ReturnItemCollectionMetrics(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnItemCollectionMetrics, + } + } + pub fn ConditionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeValues, + } + } + } + + impl Debug for DeleteItemInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for DeleteItemInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput.DeleteItemInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Key, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Expected, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionalOperator, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnItemCollectionMetrics, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for DeleteItemInput {} + + impl Hash for DeleteItemInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DeleteItemInput::DeleteItemInput { + TableName, + Key, + Expected, + ConditionalOperator, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(Key, _state); + ::std::hash::Hash::hash(Expected, _state); + ::std::hash::Hash::hash(ConditionalOperator, _state); + ::std::hash::Hash::hash(ReturnValues, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state); + ::std::hash::Hash::hash( + ReturnItemCollectionMetrics, + _state, + ); + ::std::hash::Hash::hash(ConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ) + } + } + } + } + + impl Default for DeleteItemInput { + fn default() -> DeleteItemInput { + DeleteItemInput::DeleteItemInput { + TableName: ::std::default::Default::default(), + Key: ::std::default::Default::default(), + Expected: ::std::default::Default::default(), + ConditionalOperator: ::std::default::Default::default(), + ReturnValues: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + ReturnItemCollectionMetrics: + ::std::default::Default::default(), + ConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &DeleteItemInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum DeleteItemOutput { + DeleteItemOutput { + Attributes: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsumedCapacity: ::std::rc::Rc>>, + ItemCollectionMetrics: ::std::rc::Rc>> + } + } + + impl DeleteItemOutput { + pub fn Attributes(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + DeleteItemOutput::DeleteItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => Attributes, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemOutput::DeleteItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => ConsumedCapacity, + } + } + pub fn ItemCollectionMetrics(&self) -> &::std::rc::Rc>>{ + match self { + DeleteItemOutput::DeleteItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => ItemCollectionMetrics, + } + } + } + + impl Debug for DeleteItemOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for DeleteItemOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DeleteItemOutput::DeleteItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput.DeleteItemOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Attributes, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ItemCollectionMetrics, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for DeleteItemOutput {} + + impl Hash for DeleteItemOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DeleteItemOutput::DeleteItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => { + ::std::hash::Hash::hash(Attributes, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state); + ::std::hash::Hash::hash(ItemCollectionMetrics, _state) + } + } + } + } + + impl Default for DeleteItemOutput { + fn default() -> DeleteItemOutput { + DeleteItemOutput::DeleteItemOutput { + Attributes: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + ItemCollectionMetrics: ::std::default::Default::default(), + } + } + } + + impl AsRef for &DeleteItemOutput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum DescribeTableInput { + DescribeTableInput { + TableName: + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + }, + } + + impl DescribeTableInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + DescribeTableInput::DescribeTableInput { TableName } => { + TableName + } + } + } + } + + impl Debug for DescribeTableInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for DescribeTableInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DescribeTableInput::DescribeTableInput { TableName } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableInput.DescribeTableInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for DescribeTableInput {} + + impl Hash for DescribeTableInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DescribeTableInput::DescribeTableInput { TableName } => { + ::std::hash::Hash::hash(TableName, _state) + } + } + } + } + + impl Default for DescribeTableInput { + fn default() -> DescribeTableInput { + DescribeTableInput::DescribeTableInput { + TableName: ::std::default::Default::default(), + } + } + } + + impl AsRef for &DescribeTableInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum DescribeTableOutput { + DescribeTableOutput { + Table: ::std::rc::Rc>> + } + } + + impl DescribeTableOutput { + pub fn Table(&self) -> &::std::rc::Rc>>{ + match self { + DescribeTableOutput::DescribeTableOutput { Table } => Table, + } + } + } + + impl Debug for DescribeTableOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for DescribeTableOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + DescribeTableOutput::DescribeTableOutput { Table } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableOutput.DescribeTableOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Table, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for DescribeTableOutput {} + + impl Hash for DescribeTableOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + DescribeTableOutput::DescribeTableOutput { Table } => { + ::std::hash::Hash::hash(Table, _state) + } + } + } + } + + impl Default for DescribeTableOutput { + fn default() -> DescribeTableOutput { + DescribeTableOutput::DescribeTableOutput { + Table: ::std::default::Default::default(), + } + } + } + + impl AsRef for &DescribeTableOutput { + fn as_ref(&self) -> Self { + self + } + } + + pub struct IDynamoDBClientCallHistory {} + + impl IDynamoDBClientCallHistory { + pub fn _allocate_object() -> ::dafny_runtime::Object { + ::dafny_runtime::allocate_object::() + } + } + + impl UpcastObject + for crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClientCallHistory { + ::dafny_runtime::UpcastObjectFn!(dyn ::std::any::Any); + } + + pub trait IDynamoDBClient: + ::std::any::Any + + ::dafny_runtime::UpcastObject + { + fn BatchGetItem(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn CreateTable(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn DeleteItem(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn DescribeTable(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn GetItem(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn PutItem(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn Query(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn Scan(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn TransactWriteItems(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + fn UpdateItem(&mut self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; + } + + #[derive(PartialEq, Clone)] + pub enum ExpectedAttributeValue { + ExpectedAttributeValue { + Value: ::std::rc::Rc>>, + Exists: ::std::rc::Rc>, + ComparisonOperator: ::std::rc::Rc>>, + AttributeValueList: ::std::rc::Rc>>> + } + } + + impl ExpectedAttributeValue { + pub fn Value(&self) -> &::std::rc::Rc>>{ + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => Value, + } + } + pub fn Exists( + &self, + ) -> &::std::rc::Rc> + { + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => Exists, + } + } + pub fn ComparisonOperator(&self) -> &::std::rc::Rc>>{ + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => ComparisonOperator, + } + } + pub fn AttributeValueList(&self) -> &::std::rc::Rc>>>{ + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => AttributeValueList, + } + } + } + + impl Debug for ExpectedAttributeValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ExpectedAttributeValue { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExpectedAttributeValue.ExpectedAttributeValue(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Value, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Exists, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ComparisonOperator, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeValueList, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ExpectedAttributeValue {} + + impl Hash for ExpectedAttributeValue { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ExpectedAttributeValue::ExpectedAttributeValue { + Value, + Exists, + ComparisonOperator, + AttributeValueList, + } => { + ::std::hash::Hash::hash(Value, _state); + ::std::hash::Hash::hash(Exists, _state); + ::std::hash::Hash::hash(ComparisonOperator, _state); + ::std::hash::Hash::hash(AttributeValueList, _state) + } + } + } + } + + impl Default for ExpectedAttributeValue { + fn default() -> ExpectedAttributeValue { + ExpectedAttributeValue::ExpectedAttributeValue { + Value: ::std::default::Default::default(), + Exists: ::std::default::Default::default(), + ComparisonOperator: ::std::default::Default::default(), + AttributeValueList: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ExpectedAttributeValue { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum GetItemInput { + GetItemInput { + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + Key: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + AttributesToGet: ::std::rc::Rc>, + ConsistentRead: ::std::rc::Rc>, + ReturnConsumedCapacity: ::std::rc::Rc>>, + ProjectionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>> + } + } + + impl GetItemInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => TableName, + } + } + pub fn Key(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => Key, + } + } + pub fn AttributesToGet(&self) -> &::std::rc::Rc>{ + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => AttributesToGet, + } + } + pub fn ConsistentRead( + &self, + ) -> &::std::rc::Rc> + { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => ConsistentRead, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => ReturnConsumedCapacity, + } + } + pub fn ProjectionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => ProjectionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => ExpressionAttributeNames, + } + } + } + + impl Debug for GetItemInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for GetItemInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput.GetItemInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Key, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributesToGet, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsistentRead, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProjectionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for GetItemInput {} + + impl Hash for GetItemInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + GetItemInput::GetItemInput { + TableName, + Key, + AttributesToGet, + ConsistentRead, + ReturnConsumedCapacity, + ProjectionExpression, + ExpressionAttributeNames, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(Key, _state); + ::std::hash::Hash::hash(AttributesToGet, _state); + ::std::hash::Hash::hash(ConsistentRead, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state); + ::std::hash::Hash::hash(ProjectionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ) + } + } + } + } + + impl Default for GetItemInput { + fn default() -> GetItemInput { + GetItemInput::GetItemInput { + TableName: ::std::default::Default::default(), + Key: ::std::default::Default::default(), + AttributesToGet: ::std::default::Default::default(), + ConsistentRead: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + ProjectionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &GetItemInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum GetItemOutput { + GetItemOutput { + Item: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsumedCapacity: ::std::rc::Rc>> + } + } + + impl GetItemOutput { + pub fn Item(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + GetItemOutput::GetItemOutput { + Item, + ConsumedCapacity, + } => Item, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + GetItemOutput::GetItemOutput { + Item, + ConsumedCapacity, + } => ConsumedCapacity, + } + } + } + + impl Debug for GetItemOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for GetItemOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + GetItemOutput::GetItemOutput { + Item, + ConsumedCapacity, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput.GetItemOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Item, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for GetItemOutput {} + + impl Hash for GetItemOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + GetItemOutput::GetItemOutput { + Item, + ConsumedCapacity, + } => { + ::std::hash::Hash::hash(Item, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state) + } + } + } + } + + impl Default for GetItemOutput { + fn default() -> GetItemOutput { + GetItemOutput::GetItemOutput { + Item: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + } + } + } + + impl AsRef for &GetItemOutput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum GlobalSecondaryIndex { + GlobalSecondaryIndex { + IndexName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + KeySchema: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema, + Projection: ::std::rc::Rc, + ProvisionedThroughput: ::std::rc::Rc>> + } + } + + impl GlobalSecondaryIndex { + pub fn IndexName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => IndexName, + } + } + pub fn KeySchema(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema{ + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => KeySchema, + } + } + pub fn Projection(&self) -> &::std::rc::Rc{ + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => Projection, + } + } + pub fn ProvisionedThroughput(&self) -> &::std::rc::Rc>>{ + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => ProvisionedThroughput, + } + } + } + + impl Debug for GlobalSecondaryIndex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for GlobalSecondaryIndex { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndex.GlobalSecondaryIndex(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + IndexName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeySchema, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Projection, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProvisionedThroughput, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for GlobalSecondaryIndex {} + + impl Hash for GlobalSecondaryIndex { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName, + KeySchema, + Projection, + ProvisionedThroughput, + } => { + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(KeySchema, _state); + ::std::hash::Hash::hash(Projection, _state); + ::std::hash::Hash::hash(ProvisionedThroughput, _state) + } + } + } + } + + impl Default for GlobalSecondaryIndex { + fn default() -> GlobalSecondaryIndex { + GlobalSecondaryIndex::GlobalSecondaryIndex { + IndexName: ::std::default::Default::default(), + KeySchema: ::std::default::Default::default(), + Projection: ::std::default::Default::default(), + ProvisionedThroughput: ::std::default::Default::default(), + } + } + } + + impl AsRef for &GlobalSecondaryIndex { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum GlobalSecondaryIndexDescription { + GlobalSecondaryIndexDescription { + IndexName: ::std::rc::Rc>>, + KeySchema: ::std::rc::Rc>, + Projection: ::std::rc::Rc>>, + IndexStatus: ::std::rc::Rc>>, + Backfilling: ::std::rc::Rc>, + ProvisionedThroughput: ::std::rc::Rc>>, + IndexSizeBytes: ::std::rc::Rc>, + ItemCount: ::std::rc::Rc>, + IndexArn: ::std::rc::Rc>> + } + } + + impl GlobalSecondaryIndexDescription { + pub fn IndexName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => IndexName, + } + } + pub fn KeySchema(&self) -> &::std::rc::Rc>{ + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => KeySchema, + } + } + pub fn Projection(&self) -> &::std::rc::Rc>>{ + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => Projection, + } + } + pub fn IndexStatus(&self) -> &::std::rc::Rc>>{ + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => IndexStatus, + } + } + pub fn Backfilling( + &self, + ) -> &::std::rc::Rc> + { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => Backfilling, + } + } + pub fn ProvisionedThroughput(&self) -> &::std::rc::Rc>>{ + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => ProvisionedThroughput, + } + } + pub fn IndexSizeBytes( + &self, + ) -> &::std::rc::Rc> + { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => IndexSizeBytes, + } + } + pub fn ItemCount( + &self, + ) -> &::std::rc::Rc> + { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => ItemCount, + } + } + pub fn IndexArn( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => IndexArn, + } + } + } + + impl Debug for GlobalSecondaryIndexDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for GlobalSecondaryIndexDescription { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexDescription.GlobalSecondaryIndexDescription(")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexName, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(KeySchema, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(Projection, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexStatus, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(Backfilling, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexSizeBytes, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(ItemCount, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexArn, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq for GlobalSecondaryIndexDescription {} + + impl Hash for GlobalSecondaryIndexDescription { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, } => { + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(KeySchema, _state); + ::std::hash::Hash::hash(Projection, _state); + ::std::hash::Hash::hash(IndexStatus, _state); + ::std::hash::Hash::hash(Backfilling, _state); + ::std::hash::Hash::hash(ProvisionedThroughput, _state); + ::std::hash::Hash::hash(IndexSizeBytes, _state); + ::std::hash::Hash::hash(ItemCount, _state); + ::std::hash::Hash::hash(IndexArn, _state) + }, + } + } + } + + impl Default for GlobalSecondaryIndexDescription { + fn default() -> GlobalSecondaryIndexDescription { + GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription { + IndexName: ::std::default::Default::default(), + KeySchema: ::std::default::Default::default(), + Projection: ::std::default::Default::default(), + IndexStatus: ::std::default::Default::default(), + Backfilling: ::std::default::Default::default(), + ProvisionedThroughput: ::std::default::Default::default(), + IndexSizeBytes: ::std::default::Default::default(), + ItemCount: ::std::default::Default::default(), + IndexArn: ::std::default::Default::default() + } + } + } + + impl AsRef for &GlobalSecondaryIndexDescription { + fn as_ref(&self) -> Self { + self + } + } + + pub type IndexName = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + #[derive(PartialEq, Clone)] + pub enum IndexStatus { + CREATING {}, + UPDATING {}, + DELETING {}, + ACTIVE {}, + } + + impl IndexStatus {} + + impl Debug for IndexStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for IndexStatus { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + IndexStatus::CREATING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.CREATING")?; + Ok(()) + } + IndexStatus::UPDATING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.UPDATING")?; + Ok(()) + } + IndexStatus::DELETING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.DELETING")?; + Ok(()) + } + IndexStatus::ACTIVE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.ACTIVE")?; + Ok(()) + } + } + } + } + + impl Eq for IndexStatus {} + + impl Hash for IndexStatus { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + IndexStatus::CREATING {} => {} + IndexStatus::UPDATING {} => {} + IndexStatus::DELETING {} => {} + IndexStatus::ACTIVE {} => {} + } + } + } + + impl Default for IndexStatus { + fn default() -> IndexStatus { + IndexStatus::CREATING {} + } + } + + impl AsRef for &IndexStatus { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ItemCollectionMetrics { + ItemCollectionMetrics { + ItemCollectionKey: ::std::rc::Rc, ::std::rc::Rc>>>, + SizeEstimateRangeGB: ::std::rc::Rc>> + } + } + + impl ItemCollectionMetrics { + pub fn ItemCollectionKey(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey, + SizeEstimateRangeGB, + } => ItemCollectionKey, + } + } + pub fn SizeEstimateRangeGB(&self) -> &::std::rc::Rc>>{ + match self { + ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey, + SizeEstimateRangeGB, + } => SizeEstimateRangeGB, + } + } + } + + impl Debug for ItemCollectionMetrics { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ItemCollectionMetrics { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey, + SizeEstimateRangeGB, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics.ItemCollectionMetrics(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ItemCollectionKey, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + SizeEstimateRangeGB, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ItemCollectionMetrics {} + + impl Hash for ItemCollectionMetrics { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey, + SizeEstimateRangeGB, + } => { + ::std::hash::Hash::hash(ItemCollectionKey, _state); + ::std::hash::Hash::hash(SizeEstimateRangeGB, _state) + } + } + } + } + + impl Default for ItemCollectionMetrics { + fn default() -> ItemCollectionMetrics { + ItemCollectionMetrics::ItemCollectionMetrics { + ItemCollectionKey: ::std::default::Default::default(), + SizeEstimateRangeGB: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ItemCollectionMetrics { + fn as_ref(&self) -> Self { + self + } + } + + pub type ItemCollectionSizeEstimateBound = + ::dafny_runtime::Sequence; + + pub type KeyList = ::dafny_runtime::Sequence<::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>>; + + #[derive(PartialEq, Clone)] + pub enum KeysAndAttributes { + KeysAndAttributes { + Keys: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyList, + AttributesToGet: ::std::rc::Rc>, + ConsistentRead: ::std::rc::Rc>, + ProjectionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>> + } + } + + impl KeysAndAttributes { + pub fn Keys(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyList{ + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => Keys, + } + } + pub fn AttributesToGet(&self) -> &::std::rc::Rc>{ + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => AttributesToGet, + } + } + pub fn ConsistentRead( + &self, + ) -> &::std::rc::Rc> + { + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => ConsistentRead, + } + } + pub fn ProjectionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => ProjectionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => ExpressionAttributeNames, + } + } + } + + impl Debug for KeysAndAttributes { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for KeysAndAttributes { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeysAndAttributes.KeysAndAttributes(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Keys, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributesToGet, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsistentRead, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProjectionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for KeysAndAttributes {} + + impl Hash for KeysAndAttributes { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + KeysAndAttributes::KeysAndAttributes { + Keys, + AttributesToGet, + ConsistentRead, + ProjectionExpression, + ExpressionAttributeNames, + } => { + ::std::hash::Hash::hash(Keys, _state); + ::std::hash::Hash::hash(AttributesToGet, _state); + ::std::hash::Hash::hash(ConsistentRead, _state); + ::std::hash::Hash::hash(ProjectionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ) + } + } + } + } + + impl Default for KeysAndAttributes { + fn default() -> KeysAndAttributes { + KeysAndAttributes::KeysAndAttributes { + Keys: ::std::default::Default::default(), + AttributesToGet: ::std::default::Default::default(), + ConsistentRead: ::std::default::Default::default(), + ProjectionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &KeysAndAttributes { + fn as_ref(&self) -> Self { + self + } + } + + pub type KeySchema = ::dafny_runtime::Sequence<::std::rc::Rc>; + + pub type KeySchemaAttributeName = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + #[derive(PartialEq, Clone)] + pub enum KeySchemaElement { + KeySchemaElement { + AttributeName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + KeyType: ::std::rc::Rc + } + } + + impl KeySchemaElement { + pub fn AttributeName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + KeySchemaElement::KeySchemaElement { + AttributeName, + KeyType, + } => AttributeName, + } + } + pub fn KeyType(&self) -> &::std::rc::Rc{ + match self { + KeySchemaElement::KeySchemaElement { + AttributeName, + KeyType, + } => KeyType, + } + } + } + + impl Debug for KeySchemaElement { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for KeySchemaElement { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + KeySchemaElement::KeySchemaElement { + AttributeName, + KeyType, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeySchemaElement.KeySchemaElement(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributeName, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeyType, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for KeySchemaElement {} + + impl Hash for KeySchemaElement { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + KeySchemaElement::KeySchemaElement { + AttributeName, + KeyType, + } => { + ::std::hash::Hash::hash(AttributeName, _state); + ::std::hash::Hash::hash(KeyType, _state) + } + } + } + } + + impl Default for KeySchemaElement { + fn default() -> KeySchemaElement { + KeySchemaElement::KeySchemaElement { + AttributeName: ::std::default::Default::default(), + KeyType: ::std::default::Default::default(), + } + } + } + + impl AsRef for &KeySchemaElement { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum KeyType { + HASH {}, + RANGE {}, + } + + impl KeyType {} + + impl Debug for KeyType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for KeyType { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + KeyType::HASH {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType.HASH")?; + Ok(()) + } + KeyType::RANGE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType.RANGE")?; + Ok(()) + } + } + } + } + + impl Eq for KeyType {} + + impl Hash for KeyType { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + KeyType::HASH {} => {} + KeyType::RANGE {} => {} + } + } + } + + impl Default for KeyType { + fn default() -> KeyType { + KeyType::HASH {} + } + } + + impl AsRef for &KeyType { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum LocalSecondaryIndex { + LocalSecondaryIndex { + IndexName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + KeySchema: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema, + Projection: ::std::rc::Rc + } + } + + impl LocalSecondaryIndex { + pub fn IndexName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName, + KeySchema, + Projection, + } => IndexName, + } + } + pub fn KeySchema(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema{ + match self { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName, + KeySchema, + Projection, + } => KeySchema, + } + } + pub fn Projection(&self) -> &::std::rc::Rc{ + match self { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName, + KeySchema, + Projection, + } => Projection, + } + } + } + + impl Debug for LocalSecondaryIndex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for LocalSecondaryIndex { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName, + KeySchema, + Projection, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndex.LocalSecondaryIndex(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + IndexName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeySchema, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Projection, _formatter, false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for LocalSecondaryIndex {} + + impl Hash for LocalSecondaryIndex { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName, + KeySchema, + Projection, + } => { + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(KeySchema, _state); + ::std::hash::Hash::hash(Projection, _state) + } + } + } + } + + impl Default for LocalSecondaryIndex { + fn default() -> LocalSecondaryIndex { + LocalSecondaryIndex::LocalSecondaryIndex { + IndexName: ::std::default::Default::default(), + KeySchema: ::std::default::Default::default(), + Projection: ::std::default::Default::default(), + } + } + } + + impl AsRef for &LocalSecondaryIndex { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum LocalSecondaryIndexDescription { + LocalSecondaryIndexDescription { + IndexName: ::std::rc::Rc>>, + KeySchema: ::std::rc::Rc>, + Projection: ::std::rc::Rc>>, + IndexSizeBytes: ::std::rc::Rc>, + ItemCount: ::std::rc::Rc>, + IndexArn: ::std::rc::Rc>> + } + } + + impl LocalSecondaryIndexDescription { + pub fn IndexName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexName, + } + } + pub fn KeySchema(&self) -> &::std::rc::Rc>{ + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => KeySchema, + } + } + pub fn Projection(&self) -> &::std::rc::Rc>>{ + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => Projection, + } + } + pub fn IndexSizeBytes( + &self, + ) -> &::std::rc::Rc> + { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexSizeBytes, + } + } + pub fn ItemCount( + &self, + ) -> &::std::rc::Rc> + { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => ItemCount, + } + } + pub fn IndexArn( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexArn, + } + } + } + + impl Debug for LocalSecondaryIndexDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for LocalSecondaryIndexDescription { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexDescription.LocalSecondaryIndexDescription(")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexName, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(KeySchema, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(Projection, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexSizeBytes, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(ItemCount, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexArn, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq for LocalSecondaryIndexDescription {} + + impl Hash for LocalSecondaryIndexDescription { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => { + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(KeySchema, _state); + ::std::hash::Hash::hash(Projection, _state); + ::std::hash::Hash::hash(IndexSizeBytes, _state); + ::std::hash::Hash::hash(ItemCount, _state); + ::std::hash::Hash::hash(IndexArn, _state) + }, + } + } + } + + impl Default for LocalSecondaryIndexDescription { + fn default() -> LocalSecondaryIndexDescription { + LocalSecondaryIndexDescription::LocalSecondaryIndexDescription { + IndexName: ::std::default::Default::default(), + KeySchema: ::std::default::Default::default(), + Projection: ::std::default::Default::default(), + IndexSizeBytes: ::std::default::Default::default(), + ItemCount: ::std::default::Default::default(), + IndexArn: ::std::default::Default::default(), + } + } + } + + impl AsRef for &LocalSecondaryIndexDescription { + fn as_ref(&self) -> Self { + self + } + } + + pub type NonKeyAttributeName = + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>; + + pub type NonKeyAttributeNameList = ::dafny_runtime::Sequence< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >; + + pub type NonNegativeLongObject = i64; + + pub type PositiveIntegerObject = i32; + + pub type PositiveLongObject = i64; + + #[derive(PartialEq, Clone)] + pub enum Projection { + Projection { + ProjectionType: ::std::rc::Rc>>, + NonKeyAttributes: ::std::rc::Rc> + } + } + + impl Projection { + pub fn ProjectionType(&self) -> &::std::rc::Rc>>{ + match self { + Projection::Projection { + ProjectionType, + NonKeyAttributes, + } => ProjectionType, + } + } + pub fn NonKeyAttributes(&self) -> &::std::rc::Rc>{ + match self { + Projection::Projection { + ProjectionType, + NonKeyAttributes, + } => NonKeyAttributes, + } + } + } + + impl Debug for Projection { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Projection { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Projection::Projection { + ProjectionType, + NonKeyAttributes, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Projection.Projection(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProjectionType, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + NonKeyAttributes, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Projection {} + + impl Hash for Projection { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Projection::Projection { + ProjectionType, + NonKeyAttributes, + } => { + ::std::hash::Hash::hash(ProjectionType, _state); + ::std::hash::Hash::hash(NonKeyAttributes, _state) + } + } + } + } + + impl Default for Projection { + fn default() -> Projection { + Projection::Projection { + ProjectionType: ::std::default::Default::default(), + NonKeyAttributes: ::std::default::Default::default(), + } + } + } + + impl AsRef for &Projection { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ProjectionType { + ALL {}, + KEYS_ONLY {}, + INCLUDE {}, + } + + impl ProjectionType {} + + impl Debug for ProjectionType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ProjectionType { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ProjectionType::ALL {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.ALL")?; + Ok(()) + } + ProjectionType::KEYS_ONLY {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.KEYS__ONLY")?; + Ok(()) + } + ProjectionType::INCLUDE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.INCLUDE")?; + Ok(()) + } + } + } + } + + impl Eq for ProjectionType {} + + impl Hash for ProjectionType { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ProjectionType::ALL {} => {} + ProjectionType::KEYS_ONLY {} => {} + ProjectionType::INCLUDE {} => {} + } + } + } + + impl Default for ProjectionType { + fn default() -> ProjectionType { + ProjectionType::ALL {} + } + } + + impl AsRef for &ProjectionType { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ProvisionedThroughput { + ProvisionedThroughput { + ReadCapacityUnits: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject, + WriteCapacityUnits: crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject + } + } + + impl ProvisionedThroughput { + pub fn ReadCapacityUnits(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject{ + match self { + ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits, + WriteCapacityUnits, + } => ReadCapacityUnits, + } + } + pub fn WriteCapacityUnits(&self) -> &crate::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject{ + match self { + ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits, + WriteCapacityUnits, + } => WriteCapacityUnits, + } + } + } + + impl Debug for ProvisionedThroughput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ProvisionedThroughput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits, + WriteCapacityUnits, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughput.ProvisionedThroughput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReadCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + WriteCapacityUnits, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ProvisionedThroughput {} + + impl Hash for ProvisionedThroughput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits, + WriteCapacityUnits, + } => { + ::std::hash::Hash::hash(ReadCapacityUnits, _state); + ::std::hash::Hash::hash(WriteCapacityUnits, _state) + } + } + } + } + + impl Default for ProvisionedThroughput { + fn default() -> ProvisionedThroughput { + ProvisionedThroughput::ProvisionedThroughput { + ReadCapacityUnits: ::std::default::Default::default(), + WriteCapacityUnits: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ProvisionedThroughput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ProvisionedThroughputDescription { + ProvisionedThroughputDescription { + LastIncreaseDateTime: ::std::rc::Rc>>, + LastDecreaseDateTime: ::std::rc::Rc>>, + NumberOfDecreasesToday: ::std::rc::Rc>, + ReadCapacityUnits: ::std::rc::Rc>, + WriteCapacityUnits: ::std::rc::Rc> + } + } + + impl ProvisionedThroughputDescription { + pub fn LastIncreaseDateTime( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => LastIncreaseDateTime, + } + } + pub fn LastDecreaseDateTime( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => LastDecreaseDateTime, + } + } + pub fn NumberOfDecreasesToday(&self) -> &::std::rc::Rc>{ + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => NumberOfDecreasesToday, + } + } + pub fn ReadCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => ReadCapacityUnits, + } + } + pub fn WriteCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => WriteCapacityUnits, + } + } + } + + impl Debug for ProvisionedThroughputDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ProvisionedThroughputDescription { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputDescription.ProvisionedThroughputDescription(")?; + ::dafny_runtime::DafnyPrint::fmt_print(LastIncreaseDateTime, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(LastDecreaseDateTime, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(NumberOfDecreasesToday, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(WriteCapacityUnits, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq for ProvisionedThroughputDescription {} + + impl Hash for ProvisionedThroughputDescription { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => { + ::std::hash::Hash::hash(LastIncreaseDateTime, _state); + ::std::hash::Hash::hash(LastDecreaseDateTime, _state); + ::std::hash::Hash::hash(NumberOfDecreasesToday, _state); + ::std::hash::Hash::hash(ReadCapacityUnits, _state); + ::std::hash::Hash::hash(WriteCapacityUnits, _state) + }, + } + } + } + + impl Default for ProvisionedThroughputDescription { + fn default() -> ProvisionedThroughputDescription { + ProvisionedThroughputDescription::ProvisionedThroughputDescription { + LastIncreaseDateTime: ::std::default::Default::default(), + LastDecreaseDateTime: ::std::default::Default::default(), + NumberOfDecreasesToday: ::std::default::Default::default(), + ReadCapacityUnits: ::std::default::Default::default(), + WriteCapacityUnits: ::std::default::Default::default() + } + } + } + + impl AsRef for &ProvisionedThroughputDescription { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ProvisionedThroughputOverride { + ProvisionedThroughputOverride { + ReadCapacityUnits: ::std::rc::Rc> + } + } + + impl ProvisionedThroughputOverride { + pub fn ReadCapacityUnits(&self) -> &::std::rc::Rc>{ + match self { + ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => ReadCapacityUnits, + } + } + } + + impl Debug for ProvisionedThroughputOverride { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ProvisionedThroughputOverride { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputOverride.ProvisionedThroughputOverride(")?; + ::dafny_runtime::DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq for ProvisionedThroughputOverride {} + + impl Hash for ProvisionedThroughputOverride { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => { + ::std::hash::Hash::hash(ReadCapacityUnits, _state) + }, + } + } + } + + impl Default for ProvisionedThroughputOverride { + fn default() -> ProvisionedThroughputOverride { + ProvisionedThroughputOverride::ProvisionedThroughputOverride { + ReadCapacityUnits: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ProvisionedThroughputOverride { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum Put { + Put { + Item: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ConditionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnValuesOnConditionCheckFailure: ::std::rc::Rc>> + } + } + + impl Put { + pub fn Item(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => Item, + } + } + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => TableName, + } + } + pub fn ConditionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ExpressionAttributeValues, + } + } + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &::std::rc::Rc>>{ + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => ReturnValuesOnConditionCheckFailure, + } + } + } + + impl Debug for Put { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Put { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Put.Put(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Item, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnValuesOnConditionCheckFailure, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for Put {} + + impl Hash for Put { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Put::Put { + Item, + TableName, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ReturnValuesOnConditionCheckFailure, + } => { + ::std::hash::Hash::hash(Item, _state); + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(ConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ); + ::std::hash::Hash::hash( + ReturnValuesOnConditionCheckFailure, + _state, + ) + } + } + } + } + + impl Default for Put { + fn default() -> Put { + Put::Put { + Item: ::std::default::Default::default(), + TableName: ::std::default::Default::default(), + ConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + ReturnValuesOnConditionCheckFailure: + ::std::default::Default::default(), + } + } + } + + impl AsRef for &Put { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum PutItemInput { + PutItemInput { + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + Item: ::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>, + Expected: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnValues: ::std::rc::Rc>>, + ReturnConsumedCapacity: ::std::rc::Rc>>, + ReturnItemCollectionMetrics: ::std::rc::Rc>>, + ConditionalOperator: ::std::rc::Rc>>, + ConditionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>> + } + } + + impl PutItemInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => TableName, + } + } + pub fn Item(&self) -> &::dafny_runtime::Map<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ::std::rc::Rc>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Item, + } + } + pub fn Expected(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Expected, + } + } + pub fn ReturnValues(&self) -> &::std::rc::Rc>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnValues, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnConsumedCapacity, + } + } + pub fn ReturnItemCollectionMetrics(&self) -> &::std::rc::Rc>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnItemCollectionMetrics, + } + } + pub fn ConditionalOperator(&self) -> &::std::rc::Rc>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConditionalOperator, + } + } + pub fn ConditionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeValues, + } + } + } + + impl Debug for PutItemInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for PutItemInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput.PutItemInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Item, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Expected, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnItemCollectionMetrics, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionalOperator, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for PutItemInput {} + + impl Hash for PutItemInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + PutItemInput::PutItemInput { + TableName, + Item, + Expected, + ReturnValues, + ReturnConsumedCapacity, + ReturnItemCollectionMetrics, + ConditionalOperator, + ConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(Item, _state); + ::std::hash::Hash::hash(Expected, _state); + ::std::hash::Hash::hash(ReturnValues, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state); + ::std::hash::Hash::hash( + ReturnItemCollectionMetrics, + _state, + ); + ::std::hash::Hash::hash(ConditionalOperator, _state); + ::std::hash::Hash::hash(ConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ) + } + } + } + } + + impl Default for PutItemInput { + fn default() -> PutItemInput { + PutItemInput::PutItemInput { + TableName: ::std::default::Default::default(), + Item: ::std::default::Default::default(), + Expected: ::std::default::Default::default(), + ReturnValues: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + ReturnItemCollectionMetrics: + ::std::default::Default::default(), + ConditionalOperator: ::std::default::Default::default(), + ConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &PutItemInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum PutItemOutput { + PutItemOutput { + Attributes: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsumedCapacity: ::std::rc::Rc>>, + ItemCollectionMetrics: ::std::rc::Rc>> + } + } + + impl PutItemOutput { + pub fn Attributes(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + PutItemOutput::PutItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => Attributes, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + PutItemOutput::PutItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => ConsumedCapacity, + } + } + pub fn ItemCollectionMetrics(&self) -> &::std::rc::Rc>>{ + match self { + PutItemOutput::PutItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => ItemCollectionMetrics, + } + } + } + + impl Debug for PutItemOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for PutItemOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + PutItemOutput::PutItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput.PutItemOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Attributes, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ItemCollectionMetrics, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for PutItemOutput {} + + impl Hash for PutItemOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + PutItemOutput::PutItemOutput { + Attributes, + ConsumedCapacity, + ItemCollectionMetrics, + } => { + ::std::hash::Hash::hash(Attributes, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state); + ::std::hash::Hash::hash(ItemCollectionMetrics, _state) + } + } + } + } + + impl Default for PutItemOutput { + fn default() -> PutItemOutput { + PutItemOutput::PutItemOutput { + Attributes: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + ItemCollectionMetrics: ::std::default::Default::default(), + } + } + } + + impl AsRef for &PutItemOutput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum QueryInput { + QueryInput { + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + IndexName: ::std::rc::Rc>>, + Select: ::std::rc::Rc>>, + AttributesToGet: ::std::rc::Rc>, + Limit: ::std::rc::Rc>, + ConsistentRead: ::std::rc::Rc>, + KeyConditions: ::std::rc::Rc, ::std::rc::Rc>>>, + QueryFilter: ::std::rc::Rc, ::std::rc::Rc>>>, + ConditionalOperator: ::std::rc::Rc>>, + ScanIndexForward: ::std::rc::Rc>, + ExclusiveStartKey: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnConsumedCapacity: ::std::rc::Rc>>, + ProjectionExpression: ::std::rc::Rc>>, + FilterExpression: ::std::rc::Rc>>, + KeyConditionExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>> + } + } + + impl QueryInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => TableName, + } + } + pub fn IndexName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => IndexName, + } + } + pub fn Select(&self) -> &::std::rc::Rc>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Select, + } + } + pub fn AttributesToGet(&self) -> &::std::rc::Rc>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => AttributesToGet, + } + } + pub fn Limit(&self) -> &::std::rc::Rc>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => Limit, + } + } + pub fn ConsistentRead( + &self, + ) -> &::std::rc::Rc> + { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConsistentRead, + } + } + pub fn KeyConditions(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => KeyConditions, + } + } + pub fn QueryFilter(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => QueryFilter, + } + } + pub fn ConditionalOperator(&self) -> &::std::rc::Rc>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ConditionalOperator, + } + } + pub fn ScanIndexForward( + &self, + ) -> &::std::rc::Rc> + { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ScanIndexForward, + } + } + pub fn ExclusiveStartKey(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExclusiveStartKey, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ReturnConsumedCapacity, + } + } + pub fn ProjectionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ProjectionExpression, + } + } + pub fn FilterExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => FilterExpression, + } + } + pub fn KeyConditionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => KeyConditionExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => ExpressionAttributeValues, + } + } + } + + impl Debug for QueryInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for QueryInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput.QueryInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + IndexName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Select, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributesToGet, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Limit, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsistentRead, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeyConditions, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + QueryFilter, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionalOperator, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ScanIndexForward, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExclusiveStartKey, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProjectionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + FilterExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KeyConditionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for QueryInput {} + + impl Hash for QueryInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + QueryInput::QueryInput { + TableName, + IndexName, + Select, + AttributesToGet, + Limit, + ConsistentRead, + KeyConditions, + QueryFilter, + ConditionalOperator, + ScanIndexForward, + ExclusiveStartKey, + ReturnConsumedCapacity, + ProjectionExpression, + FilterExpression, + KeyConditionExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(Select, _state); + ::std::hash::Hash::hash(AttributesToGet, _state); + ::std::hash::Hash::hash(Limit, _state); + ::std::hash::Hash::hash(ConsistentRead, _state); + ::std::hash::Hash::hash(KeyConditions, _state); + ::std::hash::Hash::hash(QueryFilter, _state); + ::std::hash::Hash::hash(ConditionalOperator, _state); + ::std::hash::Hash::hash(ScanIndexForward, _state); + ::std::hash::Hash::hash(ExclusiveStartKey, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state); + ::std::hash::Hash::hash(ProjectionExpression, _state); + ::std::hash::Hash::hash(FilterExpression, _state); + ::std::hash::Hash::hash(KeyConditionExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ) + } + } + } + } + + impl Default for QueryInput { + fn default() -> QueryInput { + QueryInput::QueryInput { + TableName: ::std::default::Default::default(), + IndexName: ::std::default::Default::default(), + Select: ::std::default::Default::default(), + AttributesToGet: ::std::default::Default::default(), + Limit: ::std::default::Default::default(), + ConsistentRead: ::std::default::Default::default(), + KeyConditions: ::std::default::Default::default(), + QueryFilter: ::std::default::Default::default(), + ConditionalOperator: ::std::default::Default::default(), + ScanIndexForward: ::std::default::Default::default(), + ExclusiveStartKey: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + ProjectionExpression: ::std::default::Default::default(), + FilterExpression: ::std::default::Default::default(), + KeyConditionExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &QueryInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum QueryOutput { + QueryOutput { + Items: ::std::rc::Rc, ::std::rc::Rc>>>>, + Count: ::std::rc::Rc>, + ScannedCount: ::std::rc::Rc>, + LastEvaluatedKey: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsumedCapacity: ::std::rc::Rc>> + } + } + + impl QueryOutput { + pub fn Items(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>>{ + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => Items, + } + } + pub fn Count( + &self, + ) -> &::std::rc::Rc> + { + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => Count, + } + } + pub fn ScannedCount( + &self, + ) -> &::std::rc::Rc> + { + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => ScannedCount, + } + } + pub fn LastEvaluatedKey(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => LastEvaluatedKey, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => ConsumedCapacity, + } + } + } + + impl Debug for QueryOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for QueryOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput.QueryOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Items, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Count, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ScannedCount, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + LastEvaluatedKey, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for QueryOutput {} + + impl Hash for QueryOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + QueryOutput::QueryOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => { + ::std::hash::Hash::hash(Items, _state); + ::std::hash::Hash::hash(Count, _state); + ::std::hash::Hash::hash(ScannedCount, _state); + ::std::hash::Hash::hash(LastEvaluatedKey, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state) + } + } + } + } + + impl Default for QueryOutput { + fn default() -> QueryOutput { + QueryOutput::QueryOutput { + Items: ::std::default::Default::default(), + Count: ::std::default::Default::default(), + ScannedCount: ::std::default::Default::default(), + LastEvaluatedKey: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + } + } + } + + impl AsRef for &QueryOutput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReplicaDescription { + ReplicaDescription { + RegionName: ::std::rc::Rc>>, + ReplicaStatus: ::std::rc::Rc>>, + ReplicaStatusDescription: ::std::rc::Rc>>, + ReplicaStatusPercentProgress: ::std::rc::Rc>>, + KMSMasterKeyId: ::std::rc::Rc>>, + ProvisionedThroughputOverride: ::std::rc::Rc>>, + GlobalSecondaryIndexes: ::std::rc::Rc>>>, + ReplicaInaccessibleDateTime: ::std::rc::Rc>>, + ReplicaTableClassSummary: ::std::rc::Rc>> + } + } + + impl ReplicaDescription { + pub fn RegionName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => RegionName, + } + } + pub fn ReplicaStatus(&self) -> &::std::rc::Rc>>{ + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ReplicaStatus, + } + } + pub fn ReplicaStatusDescription( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ReplicaStatusDescription, + } + } + pub fn ReplicaStatusPercentProgress( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ReplicaStatusPercentProgress, + } + } + pub fn KMSMasterKeyId( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => KMSMasterKeyId, + } + } + pub fn ProvisionedThroughputOverride(&self) -> &::std::rc::Rc>>{ + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ProvisionedThroughputOverride, + } + } + pub fn GlobalSecondaryIndexes(&self) -> &::std::rc::Rc>>>{ + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => GlobalSecondaryIndexes, + } + } + pub fn ReplicaInaccessibleDateTime( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ReplicaInaccessibleDateTime, + } + } + pub fn ReplicaTableClassSummary(&self) -> &::std::rc::Rc>>{ + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => ReplicaTableClassSummary, + } + } + } + + impl Debug for ReplicaDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReplicaDescription { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaDescription.ReplicaDescription(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + RegionName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReplicaStatus, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReplicaStatusDescription, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReplicaStatusPercentProgress, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + KMSMasterKeyId, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProvisionedThroughputOverride, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + GlobalSecondaryIndexes, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReplicaInaccessibleDateTime, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReplicaTableClassSummary, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ReplicaDescription {} + + impl Hash for ReplicaDescription { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReplicaDescription::ReplicaDescription { + RegionName, + ReplicaStatus, + ReplicaStatusDescription, + ReplicaStatusPercentProgress, + KMSMasterKeyId, + ProvisionedThroughputOverride, + GlobalSecondaryIndexes, + ReplicaInaccessibleDateTime, + ReplicaTableClassSummary, + } => { + ::std::hash::Hash::hash(RegionName, _state); + ::std::hash::Hash::hash(ReplicaStatus, _state); + ::std::hash::Hash::hash( + ReplicaStatusDescription, + _state, + ); + ::std::hash::Hash::hash( + ReplicaStatusPercentProgress, + _state, + ); + ::std::hash::Hash::hash(KMSMasterKeyId, _state); + ::std::hash::Hash::hash( + ProvisionedThroughputOverride, + _state, + ); + ::std::hash::Hash::hash(GlobalSecondaryIndexes, _state); + ::std::hash::Hash::hash( + ReplicaInaccessibleDateTime, + _state, + ); + ::std::hash::Hash::hash( + ReplicaTableClassSummary, + _state, + ) + } + } + } + } + + impl Default for ReplicaDescription { + fn default() -> ReplicaDescription { + ReplicaDescription::ReplicaDescription { + RegionName: ::std::default::Default::default(), + ReplicaStatus: ::std::default::Default::default(), + ReplicaStatusDescription: ::std::default::Default::default( + ), + ReplicaStatusPercentProgress: + ::std::default::Default::default(), + KMSMasterKeyId: ::std::default::Default::default(), + ProvisionedThroughputOverride: + ::std::default::Default::default(), + GlobalSecondaryIndexes: ::std::default::Default::default(), + ReplicaInaccessibleDateTime: + ::std::default::Default::default(), + ReplicaTableClassSummary: ::std::default::Default::default( + ), + } + } + } + + impl AsRef for &ReplicaDescription { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReplicaGlobalSecondaryIndexDescription { + ReplicaGlobalSecondaryIndexDescription { + IndexName: ::std::rc::Rc>>, + ProvisionedThroughputOverride: ::std::rc::Rc>> + } + } + + impl ReplicaGlobalSecondaryIndexDescription { + pub fn IndexName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, } => IndexName, + } + } + pub fn ProvisionedThroughputOverride(&self) -> &::std::rc::Rc>>{ + match self { + ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, } => ProvisionedThroughputOverride, + } + } + } + + impl Debug for ReplicaGlobalSecondaryIndexDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReplicaGlobalSecondaryIndexDescription { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexDescription.ReplicaGlobalSecondaryIndexDescription(")?; + ::dafny_runtime::DafnyPrint::fmt_print(IndexName, _formatter, false)?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq for ReplicaGlobalSecondaryIndexDescription {} + + impl Hash for ReplicaGlobalSecondaryIndexDescription { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, } => { + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(ProvisionedThroughputOverride, _state) + }, + } + } + } + + impl Default for ReplicaGlobalSecondaryIndexDescription { + fn default() -> ReplicaGlobalSecondaryIndexDescription { + ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription { + IndexName: ::std::default::Default::default(), + ProvisionedThroughputOverride: ::std::default::Default::default() + } + } + } + + impl AsRef for &ReplicaGlobalSecondaryIndexDescription { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReplicaStatus { + CREATING {}, + CREATION_FAILED {}, + UPDATING {}, + DELETING {}, + ACTIVE {}, + REGION_DISABLED {}, + INACCESSIBLE_ENCRYPTION_CREDENTIALS {}, + } + + impl ReplicaStatus {} + + impl Debug for ReplicaStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReplicaStatus { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReplicaStatus::CREATING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.CREATING")?; + Ok(()) + } + ReplicaStatus::CREATION_FAILED {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.CREATION__FAILED")?; + Ok(()) + } + ReplicaStatus::UPDATING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.UPDATING")?; + Ok(()) + } + ReplicaStatus::DELETING {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.DELETING")?; + Ok(()) + } + ReplicaStatus::ACTIVE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.ACTIVE")?; + Ok(()) + } + ReplicaStatus::REGION_DISABLED {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.REGION__DISABLED")?; + Ok(()) + } + ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.INACCESSIBLE__ENCRYPTION__CREDENTIALS")?; + Ok(()) + } + } + } + } + + impl Eq for ReplicaStatus {} + + impl Hash for ReplicaStatus { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReplicaStatus::CREATING {} => {} + ReplicaStatus::CREATION_FAILED {} => {} + ReplicaStatus::UPDATING {} => {} + ReplicaStatus::DELETING {} => {} + ReplicaStatus::ACTIVE {} => {} + ReplicaStatus::REGION_DISABLED {} => {} + ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {} => {} + } + } + } + + impl Default for ReplicaStatus { + fn default() -> ReplicaStatus { + ReplicaStatus::CREATING {} + } + } + + impl AsRef for &ReplicaStatus { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum RestoreSummary { + RestoreSummary { + SourceBackupArn: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + SourceTableArn: ::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + RestoreDateTime: + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + RestoreInProgress: bool, + }, + } + + impl RestoreSummary { + pub fn SourceBackupArn( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => SourceBackupArn, + } + } + pub fn SourceTableArn( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => SourceTableArn, + } + } + pub fn RestoreDateTime( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => RestoreDateTime, + } + } + pub fn RestoreInProgress(&self) -> &bool { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => RestoreInProgress, + } + } + } + + impl Debug for RestoreSummary { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for RestoreSummary { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreSummary.RestoreSummary(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + SourceBackupArn, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + SourceTableArn, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + RestoreDateTime, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + RestoreInProgress, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for RestoreSummary {} + + impl Hash for RestoreSummary { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + RestoreSummary::RestoreSummary { + SourceBackupArn, + SourceTableArn, + RestoreDateTime, + RestoreInProgress, + } => { + ::std::hash::Hash::hash(SourceBackupArn, _state); + ::std::hash::Hash::hash(SourceTableArn, _state); + ::std::hash::Hash::hash(RestoreDateTime, _state); + ::std::hash::Hash::hash(RestoreInProgress, _state) + } + } + } + } + + impl Default for RestoreSummary { + fn default() -> RestoreSummary { + RestoreSummary::RestoreSummary { + SourceBackupArn: ::std::default::Default::default(), + SourceTableArn: ::std::default::Default::default(), + RestoreDateTime: ::std::default::Default::default(), + RestoreInProgress: ::std::default::Default::default(), + } + } + } + + impl AsRef for &RestoreSummary { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReturnConsumedCapacity { + INDEXES {}, + TOTAL {}, + NONE {}, + } + + impl ReturnConsumedCapacity {} + + impl Debug for ReturnConsumedCapacity { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReturnConsumedCapacity { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReturnConsumedCapacity::INDEXES {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.INDEXES")?; + Ok(()) + } + ReturnConsumedCapacity::TOTAL {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.TOTAL")?; + Ok(()) + } + ReturnConsumedCapacity::NONE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.NONE")?; + Ok(()) + } + } + } + } + + impl Eq for ReturnConsumedCapacity {} + + impl Hash for ReturnConsumedCapacity { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReturnConsumedCapacity::INDEXES {} => {} + ReturnConsumedCapacity::TOTAL {} => {} + ReturnConsumedCapacity::NONE {} => {} + } + } + } + + impl Default for ReturnConsumedCapacity { + fn default() -> ReturnConsumedCapacity { + ReturnConsumedCapacity::INDEXES {} + } + } + + impl AsRef for &ReturnConsumedCapacity { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReturnItemCollectionMetrics { + SIZE {}, + NONE {}, + } + + impl ReturnItemCollectionMetrics {} + + impl Debug for ReturnItemCollectionMetrics { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReturnItemCollectionMetrics { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReturnItemCollectionMetrics::SIZE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics.SIZE")?; + Ok(()) + } + ReturnItemCollectionMetrics::NONE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics.NONE")?; + Ok(()) + } + } + } + } + + impl Eq for ReturnItemCollectionMetrics {} + + impl Hash for ReturnItemCollectionMetrics { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReturnItemCollectionMetrics::SIZE {} => {} + ReturnItemCollectionMetrics::NONE {} => {} + } + } + } + + impl Default for ReturnItemCollectionMetrics { + fn default() -> ReturnItemCollectionMetrics { + ReturnItemCollectionMetrics::SIZE {} + } + } + + impl AsRef for &ReturnItemCollectionMetrics { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReturnValue { + NONE {}, + ALL_OLD {}, + UPDATED_OLD {}, + ALL_NEW {}, + UPDATED_NEW {}, + } + + impl ReturnValue {} + + impl Debug for ReturnValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReturnValue { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReturnValue::NONE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.NONE")?; + Ok(()) + } + ReturnValue::ALL_OLD {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.ALL__OLD")?; + Ok(()) + } + ReturnValue::UPDATED_OLD {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.UPDATED__OLD")?; + Ok(()) + } + ReturnValue::ALL_NEW {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.ALL__NEW")?; + Ok(()) + } + ReturnValue::UPDATED_NEW {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.UPDATED__NEW")?; + Ok(()) + } + } + } + } + + impl Eq for ReturnValue {} + + impl Hash for ReturnValue { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReturnValue::NONE {} => {} + ReturnValue::ALL_OLD {} => {} + ReturnValue::UPDATED_OLD {} => {} + ReturnValue::ALL_NEW {} => {} + ReturnValue::UPDATED_NEW {} => {} + } + } + } + + impl Default for ReturnValue { + fn default() -> ReturnValue { + ReturnValue::NONE {} + } + } + + impl AsRef for &ReturnValue { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ReturnValuesOnConditionCheckFailure { + ALL_OLD {}, + NONE {}, + } + + impl ReturnValuesOnConditionCheckFailure {} + + impl Debug for ReturnValuesOnConditionCheckFailure { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ReturnValuesOnConditionCheckFailure { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ReturnValuesOnConditionCheckFailure::ALL_OLD {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure.ALL__OLD")?; + Ok(()) + } + ReturnValuesOnConditionCheckFailure::NONE {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure.NONE")?; + Ok(()) + } + } + } + } + + impl Eq for ReturnValuesOnConditionCheckFailure {} + + impl Hash for ReturnValuesOnConditionCheckFailure { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ReturnValuesOnConditionCheckFailure::ALL_OLD {} => {} + ReturnValuesOnConditionCheckFailure::NONE {} => {} + } + } + } + + impl Default for ReturnValuesOnConditionCheckFailure { + fn default() -> ReturnValuesOnConditionCheckFailure { + ReturnValuesOnConditionCheckFailure::ALL_OLD {} + } + } + + impl AsRef for &ReturnValuesOnConditionCheckFailure { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ScalarAttributeType { + S {}, + N {}, + B {}, + } + + impl ScalarAttributeType {} + + impl Debug for ScalarAttributeType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ScalarAttributeType { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ScalarAttributeType::S {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.S")?; + Ok(()) + } + ScalarAttributeType::N {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.N")?; + Ok(()) + } + ScalarAttributeType::B {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.B")?; + Ok(()) + } + } + } + } + + impl Eq for ScalarAttributeType {} + + impl Hash for ScalarAttributeType { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ScalarAttributeType::S {} => {} + ScalarAttributeType::N {} => {} + ScalarAttributeType::B {} => {} + } + } + } + + impl Default for ScalarAttributeType { + fn default() -> ScalarAttributeType { + ScalarAttributeType::S {} + } + } + + impl AsRef for &ScalarAttributeType { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ScanInput { + ScanInput { + TableName: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + IndexName: ::std::rc::Rc>>, + AttributesToGet: ::std::rc::Rc>, + Limit: ::std::rc::Rc>, + Select: ::std::rc::Rc>>, + ScanFilter: ::std::rc::Rc, ::std::rc::Rc>>>, + ConditionalOperator: ::std::rc::Rc>>, + ExclusiveStartKey: ::std::rc::Rc, ::std::rc::Rc>>>, + ReturnConsumedCapacity: ::std::rc::Rc>>, + TotalSegments: ::std::rc::Rc>, + Segment: ::std::rc::Rc>, + ProjectionExpression: ::std::rc::Rc>>, + FilterExpression: ::std::rc::Rc>>, + ExpressionAttributeNames: ::std::rc::Rc, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>>>, + ExpressionAttributeValues: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsistentRead: ::std::rc::Rc> + } + } + + impl ScanInput { + pub fn TableName( + &self, + ) -> &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> + { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => TableName, + } + } + pub fn IndexName( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => IndexName, + } + } + pub fn AttributesToGet(&self) -> &::std::rc::Rc>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => AttributesToGet, + } + } + pub fn Limit(&self) -> &::std::rc::Rc>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => Limit, + } + } + pub fn Select(&self) -> &::std::rc::Rc>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => Select, + } + } + pub fn ScanFilter(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ScanFilter, + } + } + pub fn ConditionalOperator(&self) -> &::std::rc::Rc>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ConditionalOperator, + } + } + pub fn ExclusiveStartKey(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ExclusiveStartKey, + } + } + pub fn ReturnConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ReturnConsumedCapacity, + } + } + pub fn TotalSegments(&self) -> &::std::rc::Rc>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => TotalSegments, + } + } + pub fn Segment(&self) -> &::std::rc::Rc>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => Segment, + } + } + pub fn ProjectionExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ProjectionExpression, + } + } + pub fn FilterExpression( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + >, + > { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => FilterExpression, + } + } + pub fn ExpressionAttributeNames( + &self, + ) -> &::std::rc::Rc< + crate::r#_Wrappers_Compile::Option< + ::dafny_runtime::Map< + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + ::dafny_runtime::Sequence< + ::dafny_runtime::DafnyCharUTF16, + >, + >, + >, + > { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ExpressionAttributeNames, + } + } + pub fn ExpressionAttributeValues(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ExpressionAttributeValues, + } + } + pub fn ConsistentRead( + &self, + ) -> &::std::rc::Rc> + { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => ConsistentRead, + } + } + } + + impl Debug for ScanInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ScanInput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanInput.ScanInput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TableName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + IndexName, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + AttributesToGet, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Limit, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Select, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ScanFilter, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConditionalOperator, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExclusiveStartKey, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ReturnConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + TotalSegments, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Segment, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ProjectionExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + FilterExpression, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeNames, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ExpressionAttributeValues, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsistentRead, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ScanInput {} + + impl Hash for ScanInput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ScanInput::ScanInput { + TableName, + IndexName, + AttributesToGet, + Limit, + Select, + ScanFilter, + ConditionalOperator, + ExclusiveStartKey, + ReturnConsumedCapacity, + TotalSegments, + Segment, + ProjectionExpression, + FilterExpression, + ExpressionAttributeNames, + ExpressionAttributeValues, + ConsistentRead, + } => { + ::std::hash::Hash::hash(TableName, _state); + ::std::hash::Hash::hash(IndexName, _state); + ::std::hash::Hash::hash(AttributesToGet, _state); + ::std::hash::Hash::hash(Limit, _state); + ::std::hash::Hash::hash(Select, _state); + ::std::hash::Hash::hash(ScanFilter, _state); + ::std::hash::Hash::hash(ConditionalOperator, _state); + ::std::hash::Hash::hash(ExclusiveStartKey, _state); + ::std::hash::Hash::hash(ReturnConsumedCapacity, _state); + ::std::hash::Hash::hash(TotalSegments, _state); + ::std::hash::Hash::hash(Segment, _state); + ::std::hash::Hash::hash(ProjectionExpression, _state); + ::std::hash::Hash::hash(FilterExpression, _state); + ::std::hash::Hash::hash( + ExpressionAttributeNames, + _state, + ); + ::std::hash::Hash::hash( + ExpressionAttributeValues, + _state, + ); + ::std::hash::Hash::hash(ConsistentRead, _state) + } + } + } + } + + impl Default for ScanInput { + fn default() -> ScanInput { + ScanInput::ScanInput { + TableName: ::std::default::Default::default(), + IndexName: ::std::default::Default::default(), + AttributesToGet: ::std::default::Default::default(), + Limit: ::std::default::Default::default(), + Select: ::std::default::Default::default(), + ScanFilter: ::std::default::Default::default(), + ConditionalOperator: ::std::default::Default::default(), + ExclusiveStartKey: ::std::default::Default::default(), + ReturnConsumedCapacity: ::std::default::Default::default(), + TotalSegments: ::std::default::Default::default(), + Segment: ::std::default::Default::default(), + ProjectionExpression: ::std::default::Default::default(), + FilterExpression: ::std::default::Default::default(), + ExpressionAttributeNames: ::std::default::Default::default( + ), + ExpressionAttributeValues: ::std::default::Default::default( + ), + ConsistentRead: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ScanInput { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum ScanOutput { + ScanOutput { + Items: ::std::rc::Rc, ::std::rc::Rc>>>>, + Count: ::std::rc::Rc>, + ScannedCount: ::std::rc::Rc>, + LastEvaluatedKey: ::std::rc::Rc, ::std::rc::Rc>>>, + ConsumedCapacity: ::std::rc::Rc>> + } + } + + impl ScanOutput { + pub fn Items(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>>{ + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => Items, + } + } + pub fn Count( + &self, + ) -> &::std::rc::Rc> + { + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => Count, + } + } + pub fn ScannedCount( + &self, + ) -> &::std::rc::Rc> + { + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => ScannedCount, + } + } + pub fn LastEvaluatedKey(&self) -> &::std::rc::Rc, ::std::rc::Rc>>>{ + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => LastEvaluatedKey, + } + } + pub fn ConsumedCapacity(&self) -> &::std::rc::Rc>>{ + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => ConsumedCapacity, + } + } + } + + impl Debug for ScanOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for ScanOutput { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanOutput.ScanOutput(")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Items, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + Count, _formatter, false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ScannedCount, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + LastEvaluatedKey, + _formatter, + false, + )?; + write!(_formatter, ", ")?; + ::dafny_runtime::DafnyPrint::fmt_print( + ConsumedCapacity, + _formatter, + false, + )?; + write!(_formatter, ")")?; + Ok(()) + } + } + } + } + + impl Eq for ScanOutput {} + + impl Hash for ScanOutput { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + ScanOutput::ScanOutput { + Items, + Count, + ScannedCount, + LastEvaluatedKey, + ConsumedCapacity, + } => { + ::std::hash::Hash::hash(Items, _state); + ::std::hash::Hash::hash(Count, _state); + ::std::hash::Hash::hash(ScannedCount, _state); + ::std::hash::Hash::hash(LastEvaluatedKey, _state); + ::std::hash::Hash::hash(ConsumedCapacity, _state) + } + } + } + } + + impl Default for ScanOutput { + fn default() -> ScanOutput { + ScanOutput::ScanOutput { + Items: ::std::default::Default::default(), + Count: ::std::default::Default::default(), + ScannedCount: ::std::default::Default::default(), + LastEvaluatedKey: ::std::default::Default::default(), + ConsumedCapacity: ::std::default::Default::default(), + } + } + } + + impl AsRef for &ScanOutput { + fn as_ref(&self) -> Self { + self + } + } + + pub type ScanSegment = i32; + + pub type ScanTotalSegments = i32; + + #[derive(PartialEq, Clone)] + pub enum Select { + ALL_ATTRIBUTES {}, + ALL_PROJECTED_ATTRIBUTES {}, + SPECIFIC_ATTRIBUTES {}, + COUNT {}, + } + + impl Select {} + + impl Debug for Select { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::dafny_runtime::DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint for Select { + fn fmt_print( + &self, + _formatter: &mut ::std::fmt::Formatter, + _in_seq: bool, + ) -> std::fmt::Result { + match self { + Select::ALL_ATTRIBUTES {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.ALL__ATTRIBUTES")?; + Ok(()) + } + Select::ALL_PROJECTED_ATTRIBUTES {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.ALL__PROJECTED__ATTRIBUTES")?; + Ok(()) + } + Select::SPECIFIC_ATTRIBUTES {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.SPECIFIC__ATTRIBUTES")?; + Ok(()) + } + Select::COUNT {} => { + write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.COUNT")?; + Ok(()) + } + } + } + } + + impl Eq for Select {} + + impl Hash for Select { + fn hash<_H: ::std::hash::Hasher>(&self, _state: &mut _H) { + match self { + Select::ALL_ATTRIBUTES {} => {} + Select::ALL_PROJECTED_ATTRIBUTES {} => {} + Select::SPECIFIC_ATTRIBUTES {} => {} + Select::COUNT {} => {} + } + } + } + + impl Default for Select { + fn default() -> Select { + Select::ALL_ATTRIBUTES {} + } + } + + impl AsRef